pgsql: Add copy/equal support for XID lists
Add copy/equal support for XID lists Commit f10a025cfe97 added support for List to store Xids, but didn't handle the new type in all cases. Add some obviously necessary pieces. As far as I am aware, this is all dead code as far as core code is concerned, but it seems unacceptable not to have it in case third-party code wants to rely on this type of list. (Some parts of the List API remain unimplemented, but that can be fixed as and when needed -- see lack of list_intersection_oid, list_deduplicate_int as precedents.) Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5ca0fe5c8ad7987beee95669124c7e245f2816d8 Modified Files -- src/backend/nodes/copyfuncs.c| 5 +++-- src/backend/nodes/equalfuncs.c | 8 src/test/modules/test_oat_hooks/test_oat_hooks.c | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-)
pgsql: Rename some functions to mention Relation instead of RelFileLoca
Rename some functions to mention Relation instead of RelFileLocator. This is definitely shorter, and hopefully clearer. Kyotaro Horiguchi, reviewed by Dilip Kumar and by me Discussion: http://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/09c5acee8ef90a9a94993dad937bdcd56ccaf1e3 Modified Files -- src/backend/storage/buffer/bufmgr.c | 63 +-- src/backend/storage/buffer/localbuf.c | 16 - src/backend/storage/smgr/smgr.c | 4 +-- src/include/storage/buf_internals.h | 7 ++-- src/include/storage/bufmgr.h | 10 +++--- 5 files changed, 50 insertions(+), 50 deletions(-)
Re: pgsql: Add copy/equal support for XID lists
Alvaro Herrera writes: > Add copy/equal support for XID lists What about outfuncs/readfuncs? I see that you fixed _outList, but not its caller outNode: else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList)) _outList(str, obj); and the LEFT_PAREN case in nodeRead() doesn't know what to do either. regards, tom lane
pgsql: Add defenses against unexpected changes in the NodeTag enum list
Add defenses against unexpected changes in the NodeTag enum list. Having different build systems producing different contents of the NodeTag enum would be catastrophic for extension ABI stability. But that ordering depends on the order in which gen_node_support.pl processes its input files. It seems too fragile to let the Makefiles, MSVC build scripts, and soon meson build scripts all set this order independently. As a klugy but serviceable solution, put a canonical copy of the file list into gen_node_support.pl itself, and check that against the files given on the command line. Also, while it's fine to add and delete node tags during development, we must not let the assigned NodeTag values change unexpectedly in stable branches. Add a cross-check that can be enabled when a branch is forked off (or later, but that is a time when we're unlikely to miss doing it). It just checks that the last auto-assigned number doesn't change, which is simplistic but will catch the most likely sorts of mistakes. From time to time we do need to add a node tag in a stable branch. To support doing that without changing the branch's auto-assigned tag numbers, invent pg_node_attr(nodetag_number(VALUE)) which can be used to give such a node a hand-assigned tag above the last auto-assigned one. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/eea9fa9b250f4044aa35d537f234c7d44fa9db3d Modified Files -- src/backend/nodes/gen_node_support.pl | 126 -- src/include/nodes/nodes.h | 5 ++ src/tools/RELEASE_CHANGES | 4 ++ 3 files changed, 113 insertions(+), 22 deletions(-)
pgsql: Invent nodetag_only attribute for Nodes.
Invent nodetag_only attribute for Nodes. This allows explaining gen_node_support.pl's handling of execnodes.h and some other input files as being a shortcut for explicit marking of all their node declarations as pg_node_attr(nodetag_only). I foresee that someday we might need to be more fine-grained about that, and this change provides the infrastructure needed to do so. For now, it just allows removal of the script's klugy special case for CallContext and InlineCodeBlock. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ca187d7455f174da40e26e6e0c8361821ee19559 Modified Files -- src/backend/nodes/gen_node_support.pl | 27 --- src/include/nodes/nodes.h | 5 + src/include/nodes/parsenodes.h| 4 3 files changed, 25 insertions(+), 11 deletions(-)
Re: pgsql: Fix out-of-bounds read in json_lex_string
On 07/12/2022 1:07 am, Tom Lane wrote: I wrote: John Naylor writes: ld: error: unable to find library -lldap_r Agreed, that looks like some unrelated platform change. Larry? Upon further thought, this looks like fallout from an upgrade to OpenLDAP 2.5, which eliminated libldap_r. That should be fine, but you might need to blow away the animal's accache files to make configure reconsider the situation. regards, tom lane I've killed the accache and ccache files, and it's flipped back to OK. Yes, ports deprecated/removed openldap24 and replaced it with openldap26, and the host got updated last night. Sorry for the grief :) -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: [email protected] US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106
Re: pgsql: Add copy/equal support for XID lists
On 2022-Jul-12, Tom Lane wrote: > What about outfuncs/readfuncs? I see that you fixed _outList, > but not its caller outNode: > > else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList)) > _outList(str, obj); > > and the LEFT_PAREN case in nodeRead() doesn't know what to do either. Hmm, true -- naively grepping for OidList wasn't enough (moreso when I failed to notice one occurrence). This patch closes the holes you mentioned. I haven't found any others yet. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La vida es para el que se aventura" >From d4dd486849c7c613dfc98cf0d7a3986dd0af4e25 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 12 Jul 2022 16:48:39 +0200 Subject: [PATCH] Fix XID list support some more Read/out support in 5ca0fe5c8ad7 was missing/incomplete, per Tom Lane. Again, as far as core is concerned, this is not only dead code but also untested; however, third parties may come to rely on it. Discussion: https://postgr.es/m/[email protected] --- src/backend/nodes/outfuncs.c | 3 ++- src/backend/nodes/read.c | 23 ++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 4d776e7b51..9e43fec86d 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -833,7 +833,8 @@ outNode(StringInfo str, const void *obj) if (obj == NULL) appendStringInfoString(str, "<>"); - else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList)) + else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList) || + IsA(obj, XidList)) _outList(str, obj); /* nodeRead does not want to see { } around these! */ else if (IsA(obj, Integer)) diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c index 1e61fde636..4a54996b63 100644 --- a/src/backend/nodes/read.c +++ b/src/backend/nodes/read.c @@ -304,7 +304,7 @@ nodeTokenType(const char *token, int length) * * Value token nodes (integers, floats, booleans, or strings); * * General nodes (via parseNodeString() from readfuncs.c); * * Lists of the above; - * * Lists of integers or OIDs. + * * Lists of integers, OIDs, or TransactionIds. * The return value is declared void *, not Node *, to avoid having to * cast it explicitly in callers that assign to fields of different types. * @@ -346,6 +346,7 @@ nodeRead(const char *token, int tok_len) /*-- * Could be an integer list: (i int int ...) * or an OID list:(o int int ...) + * or an XID list:(x int int ...) * or a list of nodes/values: (node node ...) *-- */ @@ -392,6 +393,26 @@ nodeRead(const char *token, int tok_len) l = lappend_oid(l, val); } } +else if (tok_len == 1 && token[0] == 'x') +{ + /* List of TransactionIds */ + for (;;) + { + TransactionId val; + char *endptr; + + token = pg_strtok(&tok_len); + if (token == NULL) + elog(ERROR, "unterminated List structure"); + if (token[0] == ')') + break; + val = (TransactionId) strtoul(token, &endptr, 10); + if (endptr != token + tok_len) + elog(ERROR, "unrecognized Xid: \"%.*s\"", + tok_len, token); + l = lappend_xid(l, val); + } +} else { /* List of other node types */ -- 2.30.2
pgsql: Remove trailing newlines in pg_upgrade's message strings.
Remove trailing newlines in pg_upgrade's message strings. pg_upgrade does not use common/logging.c, which is unfortunate but changing it to do so seems like more work than is justified. However, we really need to make it work more like common/logging.c in one respect: the latter expects supplied message strings to not end with a newline, instead adding one internally. As it stands, pg_upgrade's logging facilities expect a caller-supplied newline in some cases and not others, which is already an invitation to bugs, but the inconsistency with our other frontend code makes it worse. There are already several places with missing or extra newlines, and it's inevitable that there won't be more if we let this stand. Hence, run around and get rid of all trailing newlines in message strings, and add an Assert that there's not one, similar to the existing Assert in common/logging.c. Adjust the logging functions to supply a newline at the right places. (Some of these strings also have a *leading* newline, which would be a good thing to get rid of too; but this patch doesn't attempt that.) There are some consequent minor changes in output. The ones that aren't outright bug fixes are generally removal of extra blank lines that the original coding intentionally inserted. It didn't seem worth being bug-compatible with that. Patch by me, reviewed by Kyotaro Horiguchi and Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7652353d87a6753627a6b6b36d7acd68475ea7c7 Modified Files -- src/bin/pg_upgrade/check.c | 118 ++-- src/bin/pg_upgrade/controldata.c | 154 +++-- src/bin/pg_upgrade/exec.c | 40 +- src/bin/pg_upgrade/file.c | 44 +-- src/bin/pg_upgrade/function.c | 6 +- src/bin/pg_upgrade/info.c | 17 ++-- src/bin/pg_upgrade/option.c| 26 +++ src/bin/pg_upgrade/parallel.c | 14 ++-- src/bin/pg_upgrade/pg_upgrade.c| 42 +- src/bin/pg_upgrade/pg_upgrade.h| 3 +- src/bin/pg_upgrade/relfilenumber.c | 12 +-- src/bin/pg_upgrade/server.c| 18 ++--- src/bin/pg_upgrade/tablespace.c| 8 +- src/bin/pg_upgrade/util.c | 82 src/bin/pg_upgrade/version.c | 24 +++--- 15 files changed, 317 insertions(+), 291 deletions(-)
pgsql: Improve error reporting from validate_exec().
Improve error reporting from validate_exec(). validate_exec() didn't guarantee to set errno to something appropriate after a failure, leading to callers not being able to print an on-point message. Improve that. Noted by Kyotaro Horiguchi, though this isn't exactly his proposal. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/920072339f304a7da0b5de966117420c96ad78cb Modified Files -- src/bin/pg_upgrade/exec.c | 11 ++- src/common/exec.c | 16 ++-- 2 files changed, 16 insertions(+), 11 deletions(-)
pgsql: Invent qsort_interruptible().
Invent qsort_interruptible(). Justin Pryzby reported that some scenarios could cause gathering of extended statistics to spend many seconds in an un-cancelable qsort() operation. To fix, invent qsort_interruptible(), which is just like qsort_arg() except that it will also do CHECK_FOR_INTERRUPTS every so often. This bloats the backend by a couple of kB, which seems like a good investment. (We considered just enabling CHECK_FOR_INTERRUPTS in the existing qsort and qsort_arg functions, but there are some callers for which that'd demonstrably be unsafe. Opt-in seems like a better way.) For now, just apply qsort_interruptible() in statistics collection. There's probably more places where it could be useful, but we can always change other call sites as we find problems. Back-patch to v14. Before that we didn't have extended stats on expressions, so that the problem was less severe. Also, this patch depends on the sort_template infrastructure introduced in v14. Tom Lane and Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e64cdab003027acef29e713087fb667e2319f679 Modified Files -- src/backend/commands/analyze.c| 25 ++--- src/backend/statistics/extended_stats.c | 4 ++-- src/backend/statistics/mcv.c | 14 ++-- src/backend/statistics/mvdistinct.c | 4 ++-- src/backend/tsearch/ts_typanalyze.c | 22 ++- src/backend/utils/adt/array_typanalyze.c | 31 ++- src/backend/utils/adt/rangetypes_typanalyze.c | 15 +++-- src/backend/utils/sort/Makefile | 1 + src/backend/utils/sort/qsort_interruptible.c | 16 ++ src/include/port.h| 3 +++ 10 files changed, 80 insertions(+), 55 deletions(-)
pgsql: Invent qsort_interruptible().
Invent qsort_interruptible(). Justin Pryzby reported that some scenarios could cause gathering of extended statistics to spend many seconds in an un-cancelable qsort() operation. To fix, invent qsort_interruptible(), which is just like qsort_arg() except that it will also do CHECK_FOR_INTERRUPTS every so often. This bloats the backend by a couple of kB, which seems like a good investment. (We considered just enabling CHECK_FOR_INTERRUPTS in the existing qsort and qsort_arg functions, but there are some callers for which that'd demonstrably be unsafe. Opt-in seems like a better way.) For now, just apply qsort_interruptible() in statistics collection. There's probably more places where it could be useful, but we can always change other call sites as we find problems. Back-patch to v14. Before that we didn't have extended stats on expressions, so that the problem was less severe. Also, this patch depends on the sort_template infrastructure introduced in v14. Tom Lane and Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/af72b0889441e5ece199f782511d84d72fa6b88c Modified Files -- src/backend/commands/analyze.c| 25 ++--- src/backend/statistics/extended_stats.c | 4 ++-- src/backend/statistics/mcv.c | 14 ++-- src/backend/statistics/mvdistinct.c | 4 ++-- src/backend/tsearch/ts_typanalyze.c | 22 ++- src/backend/utils/adt/array_typanalyze.c | 31 ++- src/backend/utils/adt/rangetypes_typanalyze.c | 15 +++-- src/backend/utils/sort/Makefile | 1 + src/backend/utils/sort/qsort_interruptible.c | 16 ++ src/include/port.h| 3 +++ 10 files changed, 80 insertions(+), 55 deletions(-)
pgsql: Invent qsort_interruptible().
Invent qsort_interruptible(). Justin Pryzby reported that some scenarios could cause gathering of extended statistics to spend many seconds in an un-cancelable qsort() operation. To fix, invent qsort_interruptible(), which is just like qsort_arg() except that it will also do CHECK_FOR_INTERRUPTS every so often. This bloats the backend by a couple of kB, which seems like a good investment. (We considered just enabling CHECK_FOR_INTERRUPTS in the existing qsort and qsort_arg functions, but there are some callers for which that'd demonstrably be unsafe. Opt-in seems like a better way.) For now, just apply qsort_interruptible() in statistics collection. There's probably more places where it could be useful, but we can always change other call sites as we find problems. Back-patch to v14. Before that we didn't have extended stats on expressions, so that the problem was less severe. Also, this patch depends on the sort_template infrastructure introduced in v14. Tom Lane and Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/12c99c88442d18e82daf521907a6e3d9003295ee Modified Files -- src/backend/commands/analyze.c| 25 ++--- src/backend/statistics/extended_stats.c | 4 ++-- src/backend/statistics/mcv.c | 14 ++-- src/backend/statistics/mvdistinct.c | 4 ++-- src/backend/tsearch/ts_typanalyze.c | 22 ++- src/backend/utils/adt/array_typanalyze.c | 31 ++- src/backend/utils/adt/rangetypes_typanalyze.c | 15 +++-- src/backend/utils/sort/Makefile | 1 + src/backend/utils/sort/qsort_interruptible.c | 16 ++ src/include/port.h| 3 +++ 10 files changed, 80 insertions(+), 55 deletions(-)
pgsql: Fix ECPG's handling of type names that match SQL keywords.
Fix ECPG's handling of type names that match SQL keywords. Previously, ECPG could only cope with variable declarations whose type names either weren't any SQL keyword, or were at least partially reserved. If you tried to use something in the unreserved_keyword category, you got a syntax error. This is pretty awful, not only because it says right on the tin that those words are not reserved, but because the set of such keywords tends to grow over time. Thus, an ECPG program that was just fine last year could fail when recompiled with a newer SQL grammar. We had to work around this recently when STRING became a keyword, but it's time for an actual fix instead of a band-aid. To fix, borrow a trick from C parsers and make the lexer's behavior change when it sees a word that is known as a typedef. This is not free of downsides: if you try to use such a name as a SQL keyword in EXEC SQL later in the program, it won't be recognized as a SQL keyword, leading to a syntax error there instead. So in a real sense this is just trading one hazard for another. But there is an important difference: with this, whether your ECPG program works depends only on what typedef names and SQL commands are used in the program text. If it compiles today it'll still compile next year, even if more words have become SQL keywords. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/83f1c7b742e80d5aa15e6710ecb324e388d007b3 Modified Files -- doc/src/sgml/ecpg.sgml | 39 - src/interfaces/ecpg/preproc/ecpg.trailer | 170 ++--- src/interfaces/ecpg/preproc/ecpg.type | 1 - src/interfaces/ecpg/preproc/pgc.l | 17 ++- src/interfaces/ecpg/preproc/preproc_extern.h | 2 +- src/interfaces/ecpg/preproc/variable.c | 13 +- src/interfaces/ecpg/test/expected/preproc-type.c | 56 --- .../ecpg/test/expected/preproc-type.stderr | 36 ++--- src/interfaces/ecpg/test/preproc/type.pgc | 8 +- 9 files changed, 236 insertions(+), 106 deletions(-)
pgsql: Tidy up code in get_cheapest_group_keys_order()
Tidy up code in get_cheapest_group_keys_order() There are a few things that we could do a little better within get_cheapest_group_keys_order(): 1. We should be using list_free() rather than pfree() on a List. 2. We should use for_each_from() instead of manually coding a for loop to skip the first n elements of a List 3. list_truncate(list_copy(...), n) is not a great way to copy the first n elements of a list. Let's invent list_copy_head() for that. That way we don't need to copy the entire list just to truncate it directly afterwards. 4. We can simplify finding the cheapest cost by setting the cheapest cost variable to DBL_MAX. That allows us to skip special-casing the initial iteration of the loop. Author: David Rowley Discussion: https://postgr.es/m/caaphdvrgyl3ft8waekncg9y5hdmu5tffjb1paotc8zi9yk9...@mail.gmail.com Backpatch-through: 15, where get_cheapest_group_keys_order was added. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4cc832f94a583146fcf7886c9ce685894956d804 Modified Files -- src/backend/nodes/list.c | 21 + src/backend/optimizer/path/pathkeys.c | 34 ++ src/include/nodes/pg_list.h | 1 + 3 files changed, 40 insertions(+), 16 deletions(-)
pgsql: Tidy up code in get_cheapest_group_keys_order()
Tidy up code in get_cheapest_group_keys_order() There are a few things that we could do a little better within get_cheapest_group_keys_order(): 1. We should be using list_free() rather than pfree() on a List. 2. We should use for_each_from() instead of manually coding a for loop to skip the first n elements of a List 3. list_truncate(list_copy(...), n) is not a great way to copy the first n elements of a list. Let's invent list_copy_head() for that. That way we don't need to copy the entire list just to truncate it directly afterwards. 4. We can simplify finding the cheapest cost by setting the cheapest cost variable to DBL_MAX. That allows us to skip special-casing the initial iteration of the loop. Author: David Rowley Discussion: https://postgr.es/m/caaphdvrgyl3ft8waekncg9y5hdmu5tffjb1paotc8zi9yk9...@mail.gmail.com Backpatch-through: 15, where get_cheapest_group_keys_order was added. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/44b5d5625389c2e001e0ffe3d435c35965862adc Modified Files -- src/backend/nodes/list.c | 21 + src/backend/optimizer/path/pathkeys.c | 34 ++ src/include/nodes/pg_list.h | 1 + 3 files changed, 40 insertions(+), 16 deletions(-)
Re: pgsql: Clarify that pg_dump takes ACCESS SHARE lock
On Fri, Jul 1, 2022 at 11:43 AM John Naylor wrote: > > Clarify that pg_dump takes ACCESS SHARE lock It occurred to me that this could easily be backpatched to v15. Since it's not a mistake or omission, there's less of a case to go back further than that. Opinions? -- John Naylor EDB: http://www.enterprisedb.com
pgsql: createuser: Cleanup and fix internal option ordering
createuser: Cleanup and fix internal option ordering This utility supports 23 options that are not really ordered in the code, making the addition of new things more complicated than necessary. This cleanup is in preparation for a patch to add even more options. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/50e4c280f0661f3ef837d2c3beb5fcc100202324 Modified Files -- src/bin/scripts/createuser.c | 98 ++-- 1 file changed, 49 insertions(+), 49 deletions(-)
pgsql: Use list_copy_head() instead of list_truncate(list_copy(...), ..
Use list_copy_head() instead of list_truncate(list_copy(...), ...) Truncating off the end of a freshly copied List is not a very efficient way of copying the first N elements of a List. In many of the cases that are updated here, the pattern was only being used to remove the final element of a List. That's about the best case for it, but there were many instances where the truncate trimming the List down much further. 4cc832f94 added list_copy_head(), so let's use it in cases where it's useful. Author: David Rowley Discussion: https://postgr.es/m/1986787.1657666922%40sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c23e3e6beb273ae8c0f8e616edb7ed1acb0271c4 Modified Files -- src/backend/catalog/objectaddress.c | 8 src/backend/commands/dropcmds.c | 15 +++ src/backend/commands/sequence.c | 2 +- src/backend/optimizer/path/allpaths.c | 9 - src/backend/optimizer/path/indxpath.c | 14 ++ src/backend/optimizer/path/pathkeys.c | 2 +- src/backend/optimizer/plan/createplan.c | 5 ++--- 7 files changed, 25 insertions(+), 30 deletions(-)
pgsql: createuser: Add support for more clause types through new option
createuser: Add support for more clause types through new options The following options are added to createuser: * --valid-until to generate a VALID UNTIL clause for the role created. * --bypassrls/--no-bypassrls for BYPASSRLS/NOBYPASSRLS. * -m/--member to make the new role a member of an existing role, with an extra ROLE clause generated. The clause generated overlaps with -g/--role, but per discussion this was the most popular choice as option name. * -a/--admin for the addition of an ADMIN clause. These option names are chosen to be completely new, so as they do not impact anybody relying on the existing option set. Tests are added for the new options and extended a bit, while on it, to cover more patterns where quotes are added to various elements of the query generated. Author: Shinya Kato Reviewed-by: Nathan Bossart, Daniel Gustafsson, Robert Haas, Kyotaro Horiguchi, David G. Johnston, Przemysław Sztoch Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/08951a7c93cf0dd791ee6ac8a8cf5e4b152528e5 Modified Files -- doc/src/sgml/ref/createuser.sgml| 56 + src/bin/scripts/createuser.c| 72 +++-- src/bin/scripts/t/040_createuser.pl | 32 +++-- 3 files changed, 156 insertions(+), 4 deletions(-)
pgsql: Small cleanup of create_list_bounds()
Small cleanup of create_list_bounds() When checking for interleaved partitions, we mark the partition as interleaved when; 1. we find an earlier partition index when looping over the sorted-by-Datum indexes[] array, or; 2. we find that the NULL partition allows some non-NULL Datum value. In the code, as it was written in db632fbca we'll continue to check for case 2 when we've already marked the partition as interleaved for case 1. Here we make it so we don't bother marking the partition as interleaved for case 2 when it's already been marked due to case 1. Really all this saves is a useless call to bms_add_member(), but since this code is new to PG15, it seems worth fixing it now to save anyone the trouble of complaining at some time in the future. We have the opportunity to improve this now before PG15 is out. This might ease some future back-patching pain. Per report and patch by Zhihong Yu. However, I slightly revised the comments and altered the bms_add_member() code to match in both locations. We already know that index is equal to boundinfo->null_index from the if condition. Author: Zhihong Yu Discussion: https://postgr.es/m/calnj-vqbzr0pyxz9zq5bqxvcwtggngvupeepnt65hz+ywzn...@mail.gmail.com Backpatch-through: 15, same as db632fbca. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f29199d3190ffdc48f40233f58a346bbb906c060 Modified Files -- src/backend/partitioning/partbounds.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)
pgsql: Small cleanup of create_list_bounds()
Small cleanup of create_list_bounds() When checking for interleaved partitions, we mark the partition as interleaved when; 1. we find an earlier partition index when looping over the sorted-by-Datum indexes[] array, or; 2. we find that the NULL partition allows some non-NULL Datum value. In the code, as it was written in db632fbca we'll continue to check for case 2 when we've already marked the partition as interleaved for case 1. Here we make it so we don't bother marking the partition as interleaved for case 2 when it's already been marked due to case 1. Really all this saves is a useless call to bms_add_member(), but since this code is new to PG15, it seems worth fixing it now to save anyone the trouble of complaining at some time in the future. We have the opportunity to improve this now before PG15 is out. This might ease some future back-patching pain. Per report and patch by Zhihong Yu. However, I slightly revised the comments and altered the bms_add_member() code to match in both locations. We already know that index is equal to boundinfo->null_index from the if condition. Author: Zhihong Yu Discussion: https://postgr.es/m/calnj-vqbzr0pyxz9zq5bqxvcwtggngvupeepnt65hz+ywzn...@mail.gmail.com Backpatch-through: 15, same as db632fbca. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/559ec79e320e51a1a6ab24af1ff4a07fbb4de19f Modified Files -- src/backend/partitioning/partbounds.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)
pgsql: NLS: Put list of available languages into LINGUAS files
NLS: Put list of available languages into LINGUAS files This moves the list of available languages from nls.mk into a separate file called po/LINGUAS. Advantages: - It keeps the parts notionally managed by programmers (nls.mk) separate from the parts notionally managed by translators (LINGUAS). - It's the standard practice recommended by the Gettext manual nowadays. - The Meson build system also supports this layout (and of course doesn't know anything about our custom nls.mk), so this would enable sharing the list of languages between the two build systems. (The MSVC build system currently finds all po files by globbing, so it is not affected by this change.) Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/88dad06b47eb80f699211c9b0b7a1c6d9016ad19 Modified Files -- doc/src/sgml/nls.sgml | 23 ++- src/backend/nls.mk | 1 - src/backend/po/LINGUAS | 1 + src/bin/initdb/nls.mk | 1 - src/bin/initdb/po/LINGUAS | 1 + src/bin/pg_amcheck/nls.mk | 1 - src/bin/pg_amcheck/po/LINGUAS | 1 + src/bin/pg_archivecleanup/nls.mk | 1 - src/bin/pg_archivecleanup/po/LINGUAS | 1 + src/bin/pg_basebackup/nls.mk | 1 - src/bin/pg_basebackup/po/LINGUAS | 1 + src/bin/pg_checksums/nls.mk| 1 - src/bin/pg_checksums/po/LINGUAS| 1 + src/bin/pg_config/nls.mk | 1 - src/bin/pg_config/po/LINGUAS | 1 + src/bin/pg_controldata/nls.mk | 1 - src/bin/pg_controldata/po/LINGUAS | 1 + src/bin/pg_ctl/nls.mk | 1 - src/bin/pg_ctl/po/LINGUAS | 1 + src/bin/pg_dump/nls.mk | 1 - src/bin/pg_dump/po/LINGUAS | 1 + src/bin/pg_resetwal/nls.mk | 1 - src/bin/pg_resetwal/po/LINGUAS | 1 + src/bin/pg_rewind/nls.mk | 1 - src/bin/pg_rewind/po/LINGUAS | 1 + src/bin/pg_test_fsync/nls.mk | 1 - src/bin/pg_test_fsync/po/LINGUAS | 1 + src/bin/pg_test_timing/nls.mk | 1 - src/bin/pg_test_timing/po/LINGUAS | 1 + src/bin/pg_upgrade/nls.mk | 1 - src/bin/pg_upgrade/po/LINGUAS | 1 + src/bin/pg_verifybackup/nls.mk | 1 - src/bin/pg_verifybackup/po/LINGUAS | 1 + src/bin/pg_waldump/nls.mk | 1 - src/bin/pg_waldump/po/LINGUAS | 1 + src/bin/psql/nls.mk| 1 - src/bin/psql/po/LINGUAS| 1 + src/bin/scripts/nls.mk | 1 - src/bin/scripts/po/LINGUAS | 1 + src/interfaces/ecpg/ecpglib/nls.mk | 1 - src/interfaces/ecpg/ecpglib/po/LINGUAS | 1 + src/interfaces/ecpg/preproc/nls.mk | 1 - src/interfaces/ecpg/preproc/po/LINGUAS | 1 + src/interfaces/libpq/nls.mk| 1 - src/interfaces/libpq/po/LINGUAS| 1 + src/nls-global.mk | 6 +- src/pl/plperl/nls.mk | 1 - src/pl/plperl/po/LINGUAS | 1 + src/pl/plpgsql/src/nls.mk | 1 - src/pl/plpgsql/src/po/LINGUAS | 1 + src/pl/plpython/nls.mk | 1 - src/pl/plpython/po/LINGUAS | 1 + src/pl/tcl/nls.mk | 1 - src/pl/tcl/po/LINGUAS | 1 + 54 files changed, 41 insertions(+), 40 deletions(-)
