pgsql: Disallow specifying ON_ERROR option without value.

2024-04-16 Thread Masahiko Sawada
Disallow specifying ON_ERROR option without value. The ON_ERROR option of the COPY command previously allowed omitting its value, which was inconsistent with the syntax synopsis in the documentation and the behavior of other non-boolean COPY options. This change enforces providing a value for

pgsql: Update mmgr's README to mention BumpContext

2024-04-16 Thread David Rowley
Update mmgr's README to mention BumpContext Oversight in 29f6a959c. In passing, since we now have 4 memory context types to choose from, provide a brief overview of the specialities of each memory context type. Reported-by: Amul Sul Author: Amul Sul, David Rowley Discussion:

pgsql: Push dedicated BumpBlocks to the tail of the blocks list

2024-04-16 Thread David Rowley
Push dedicated BumpBlocks to the tail of the blocks list BumpContext relies on using the head block from its 'blocks' field to use as the current block to allocate new chunks to. When we receive an allocation request larger than allocChunkLimit, we place these chunks on a new dedicated block

pgsql: Mark some new location fields as ParseLoc

2024-04-16 Thread Peter Eisentraut
Mark some new location fields as ParseLoc Some new code probably didn't see 605721f819f and continued to use type int for parse location fields. Fix those. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2ea5d8bece85518b4b8c052ff134c294c21543e0 Modified Files

pgsql: Clean up more indent breakage from 6377e12a5.

2024-04-16 Thread Tom Lane
Clean up more indent breakage from 6377e12a5. Per buildfarm member koel. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ec07d0d7fae9ac990061bef1aa8995f842839a40 Modified Files -- src/include/foreign/fdwapi.h | 2 +- 1 file changed, 1 insertion(+), 1

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix assorted bugs in ecpg's macro mechanism.

2024-04-16 Thread Tom Lane
Fix assorted bugs in ecpg's macro mechanism. The code associated with EXEC SQL DEFINE was unreadable and full of bugs, notably: * It'd attempt to free a non-malloced string if the ecpg program tries to redefine a macro that was defined on the command line. * Possible memory stomp if user writes

pgsql: Fix nbtree "deduce NOT NULL" scan key comment.

2024-04-16 Thread Peter Geoghegan
Fix nbtree "deduce NOT NULL" scan key comment. Oversight in commit c9c0589fda. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c62d2ebd9e6f94758f5ed3a28cf08861229ae421 Modified Files -- src/backend/access/nbtree/nbtsearch.c | 2 +- 1 file changed, 1

pgsql: Undo incorrect typedefs.list change.

2024-04-16 Thread Tom Lane
Undo incorrect typedefs.list change. 6377e12a5 should not have removed AcquireSampleRowsFunc, as that's still in use. Per buildfarm member koel. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/984c0eccd0ccfcd7df8df47586e3b935a8124a15 Modified Files --

pgsql: Stabilize test of BRIN parallel create

2024-04-16 Thread Tomas Vondra
Stabilize test of BRIN parallel create The test for parallel create of BRIN indexes added by commit 8225c2fd40 happens to be unstable - a background transaction (e.g. auto-analyze) may hold back global xmin for the initial VACUUM / CREATE INDEX. If the cleanup happens before the next CREATE

pgsql: Fix generation of EC join conditions at the wrong plan level.

2024-04-16 Thread Tom Lane
Fix generation of EC join conditions at the wrong plan level. get_baserel_parampathinfo previously assumed without checking that the results of generate_join_implied_equalities "necessarily satisfy join_clause_is_movable_into". This turns out to be wrong in the presence of outer joins, because

pgsql: Ensure generated join clauses for child rels have correct relids

2024-04-16 Thread Tom Lane
Ensure generated join clauses for child rels have correct relids. When building a join clause derived from an EquivalenceClass, if the clause is to be used with an appendrel child relation then make sure its clause_relids include the relids of that child relation. Normally this would be true

pgsql: Fix generation of EC join conditions at the wrong plan level.

2024-04-16 Thread Tom Lane
Fix generation of EC join conditions at the wrong plan level. get_baserel_parampathinfo previously assumed without checking that the results of generate_join_implied_equalities "necessarily satisfy join_clause_is_movable_into". This turns out to be wrong in the presence of outer joins, because

pgsql: Ensure generated join clauses for child rels have correct relids

2024-04-16 Thread Tom Lane
Ensure generated join clauses for child rels have correct relids. When building a join clause derived from an EquivalenceClass, if the clause is to be used with an appendrel child relation then make sure its clause_relids include the relids of that child relation. Normally this would be true

pgsql: Fix generation of EC join conditions at the wrong plan level.

2024-04-16 Thread Tom Lane
Fix generation of EC join conditions at the wrong plan level. get_baserel_parampathinfo previously assumed without checking that the results of generate_join_implied_equalities "necessarily satisfy join_clause_is_movable_into". This turns out to be wrong in the presence of outer joins, because

pgsql: Fix generation of EC join conditions at the wrong plan level.

2024-04-16 Thread Tom Lane
Fix generation of EC join conditions at the wrong plan level. get_baserel_parampathinfo previously assumed without checking that the results of generate_join_implied_equalities "necessarily satisfy join_clause_is_movable_into". This turns out to be wrong in the presence of outer joins, because

pgsql: Fix nbtree posting list comment.

2024-04-16 Thread Peter Geoghegan
Fix nbtree posting list comment. Oversight in commit 0d861bbb70. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f6987041557f2b2b96f116c1f3150f9ed9a77c89 Modified Files -- src/include/access/nbtree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix nbtree page recycling comment.

2024-04-16 Thread Peter Geoghegan
Fix nbtree page recycling comment. Oversight in commit e5d8a99903. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/aa1def44c301ce7fae9ae33f0a95bc01efa297a3 Modified Files -- src/include/access/nbtree.h | 2 +- 1 file changed, 1 insertion(+), 1

pgsql: revert: Generalize relation analyze in table AM interface

2024-04-16 Thread Alexander Korotkov
revert: Generalize relation analyze in table AM interface This commit reverts 27bc1772fc and dd1f6b0c17. Per review by Andres Freund. Discussion: https://postgr.es/m/20240415201057.khoyxbwwxfgzomeo%40awork3.anarazel.de Branch -- master Details ---