pgsql: Fix whitespace

2024-10-16 Thread Peter Eisentraut
Fix whitespace Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e90d108823ad647bc67327ee14ebfd097f262c8f Modified Files -- src/test/regress/expected/merge.out | 1 - src/test/regress/sql/merge.sql | 2 +- 2 files changed, 1 insertion(+), 2 delet

pgsql: Fix whitespace

2024-10-16 Thread Peter Eisentraut
Fix whitespace Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6234a9ce0ef188d73caca1fe0f2ce79d2029009c Modified Files -- src/test/regress/expected/merge.out | 1 - src/test/regress/sql/merge.sql | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)

pgsql: Fix unnecessary casts of copyObject() result

2024-10-16 Thread Peter Eisentraut
Fix unnecessary casts of copyObject() result The result is already of the correct type, so these casts don't do anything. Reviewed-by: Nathan Bossart Reviewed-by: Tender Wang Discussion: https://www.postgresql.org/message-id/flat/637eeea8-5663-460b-a114-39572c0f6c6e%40eisentraut.org Branch --

pgsql: Improve node type forward reference

2024-10-16 Thread Peter Eisentraut
Improve node type forward reference Instead of using Node *, we can use an incomplete struct. That way, everything has the correct type and fewer casts are required. This technique is already used elsewhere in node type definitions. Reviewed-by: Nathan Bossart Reviewed-by: Tender Wang Discuss

pgsql: jsonapi: fully initialize dummy lexer

2024-10-16 Thread Peter Eisentraut
jsonapi: fully initialize dummy lexer Valgrind reports that checks on lex->inc_state are undefined for the "dummy lexer" used for incremental parsing, since it's only partially initialized on the stack. This was introduced in 0785d1b8b2. Zero-initialize the whole struct. Author: Jacob Champion R

pgsql: Fix unusual include style

2024-10-16 Thread Peter Eisentraut
Fix unusual include style Project-internal header files should be included using " ", not < >. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/342fb8a332007fb64fb1450e28194c36e9da3d6b Modified Files -- src/test/modules/test_rls_hooks/test_rls_hooks.h |

pgsql: Don't store intermediate hash values in ExprState->resvalue

2024-10-16 Thread David Rowley
Don't store intermediate hash values in ExprState->resvalue adf97c156 made it so ExprStates could support hashing and changed Hash Join to use that instead of manually extracting Datums from tuples and hashing them one column at a time. When hashing multiple columns or expressions, the code added

pgsql: Fix validation of COPY FORCE_NOT_NULL/FORCE_NULL for the all-col

2024-10-16 Thread Michael Paquier
Fix validation of COPY FORCE_NOT_NULL/FORCE_NULL for the all-column cases This commit adds missing checks for COPY FORCE_NOT_NULL and FORCE_NULL when applied to all columns via "*". These options now correctly require CSV mode and are disallowed in COPY TO, making their behavior consistent with F

pgsql: Fix validation of COPY FORCE_NOT_NULL/FORCE_NULL for the all-col

2024-10-16 Thread Michael Paquier
Fix validation of COPY FORCE_NOT_NULL/FORCE_NULL for the all-column cases This commit adds missing checks for COPY FORCE_NOT_NULL and FORCE_NULL when applied to all columns via "*". These options now correctly require CSV mode and are disallowed in COPY TO, making their behavior consistent with F

pgsql: Rewrite some regression queries for option checks with COPY

2024-10-16 Thread Michael Paquier
Rewrite some regression queries for option checks with COPY Some queries in copy2 are there to check various option combinations, and used "stdin" or "stdout" incompatible with the COPY TO or FROM clauses combined with them, which was confusing. This commit rewrites these queries to use a compati

pgsql: Rewrite some regression queries for option checks with COPY

2024-10-16 Thread Michael Paquier
Rewrite some regression queries for option checks with COPY Some queries in copy2 are there to check various option combinations, and used "stdin" or "stdout" incompatible with the COPY TO or FROM clauses combined with them, which was confusing. This commit rewrites these queries to use a compati

pgsql: Rewrite some regression queries for option checks with COPY

2024-10-16 Thread Michael Paquier
Rewrite some regression queries for option checks with COPY Some queries in copy2 are there to check various option combinations, and used "stdin" or "stdout" incompatible with the COPY TO or FROM clauses combined with them, which was confusing. This commit rewrites these queries to use a compati

pgsql: nbtree: fix read page recheck typo.

2024-10-16 Thread Peter Geoghegan
nbtree: fix read page recheck typo. Oversight in commit 79fa7b3b. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c0490b0ef773d8694d1a9bfbf4116a102c07458d Modified Files -- src/backend/access/nbtree/nbtsearch.c | 2 +- 1 file changed, 1 insertion(+), 1 d

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

pgsql: Further refine _SPI_execute_plan's rule for atomic execution.

2024-10-16 Thread Tom Lane
Further refine _SPI_execute_plan's rule for atomic execution. Commit 2dc1deaea turns out to have been still a brick shy of a load, because CALL statements executing within a plpgsql exception block could still pass the wrong snapshot to stable functions within the CALL's argument list. That happe

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-16 Thread Alexander Korotkov
On Wed, Oct 16, 2024 at 10:35 PM Peter Eisentraut wrote: > On 02.09.24 01:55, Alexander Korotkov wrote: > > On Mon, Sep 2, 2024 at 2:28 AM Michael Paquier wrote: > >> On Sun, Sep 01, 2024 at 10:35:27PM +0300, Alexander Korotkov wrote: > >>> This path hasn't changes since the patch revision when i

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-16 Thread Peter Eisentraut
On 02.09.24 01:55, Alexander Korotkov wrote: On Mon, Sep 2, 2024 at 2:28 AM Michael Paquier wrote: On Sun, Sep 01, 2024 at 10:35:27PM +0300, Alexander Korotkov wrote: This path hasn't changes since the patch revision when it was a utility command. I agree that this doesn't look like proper pa

pgsql: Whitespace fixup from generated unicode tables.

2024-10-16 Thread Jeff Davis
Whitespace fixup from generated unicode tables. When running the 'update-unicode' build target, generate files that conform to pgindent whitespace rules. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a7f2f6adc240a2823c2344b89e90bb630dea8803 Modified Files ---

Re: pgsql: Create functions pg_set_relation_stats, pg_clear_relation_stats.

2024-10-16 Thread Jeff Davis
On Tue, 2024-10-15 at 02:00 +0300, Alexander Korotkov wrote: > Please, check the alphabetical order of includes in stat_utils.c. Thank you, fixed. Did you use a tool or just happen to notice? Regards, Jeff Davis

pgsql: Fix #include order from e839c8ecc9.

2024-10-16 Thread Jeff Davis
Fix #include order from e839c8ecc9. Reported-by: Alexander Korotkov Discussion: https://postgr.es/m/capphfduaigssvuc614z-jonyqffcmejncwmf2hnul8wfy4f...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b360d1762b55c3ff36e8b14c6a2286e5d4f61974 Modified

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: ecpg: fix some minor mishandling of bad input in preprocessor.

2024-10-16 Thread Tom Lane
ecpg: fix some minor mishandling of bad input in preprocessor. Avoid null-pointer crash when considering a cursor declaration that's outside any C function (a case which is useless anyway). Ensure a cursor for a prepared statement is marked as initially not open. At worst, if we chanced to get n

pgsql: Normalize nbtree truncated high key array behavior.

2024-10-16 Thread Peter Geoghegan
Normalize nbtree truncated high key array behavior. Commit 5bf748b8 taught nbtree ScalarArrayOp index scans to decide when and how to start the next primitive index scan based on physical index characteristics. This included rules for deciding whether to start a new primitive index scan (or wheth

Re: pgsql: Fix typo in comment of transformJsonAggConstructor()

2024-10-16 Thread Amit Langote
On Wed, Oct 16, 2024 at 8:39 PM Amit Langote wrote: > > Fix typo in comment of transformJsonAggConstructor() > > An oversight of 3a8a1f3254b. > > Reported-by: Tender Wang > Author: Tender Wang > Backpatch-through: 16 Sorry, I forgot to put the Discussion link: https://www.postgresql.org/messag

pgsql: Fix typo in comment of transformJsonAggConstructor()

2024-10-16 Thread Amit Langote
Fix typo in comment of transformJsonAggConstructor() An oversight of 3a8a1f3254b. Reported-by: Tender Wang Author: Tender Wang Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c259b1578e006b2f808595fac4d8e45c5cce9d73 Modified Files -

pgsql: Fix typo in comment of transformJsonAggConstructor()

2024-10-16 Thread Amit Langote
Fix typo in comment of transformJsonAggConstructor() An oversight of 3a8a1f3254b. Reported-by: Tender Wang Author: Tender Wang Backpatch-through: 16 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/064e04008533b2b8a82b5dbff7da10abd6e41565 Modified Files --

pgsql: Fix typo in comment of transformJsonAggConstructor()

2024-10-16 Thread Amit Langote
Fix typo in comment of transformJsonAggConstructor() An oversight of 3a8a1f3254b. Reported-by: Tender Wang Author: Tender Wang Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4a933eefe11208d02552f34c8fb3a2b13caeb286 Modified Files --