pgsql: Fix BF failure introduced by commit b3f6b14cf4.

2024-02-29 Thread Amit Kapila
Fix BF failure introduced by commit b3f6b14cf4. The test added by commit b3f6b14cf4 uses a non-superuser and forgot to set up pg_hba.conf to allow connections from it. The special setup is only needed on Windows machines that don't use UNIX sockets. As per buildfarm Discussion:

pgsql: Convert unloggedLSN to an atomic variable.

2024-02-29 Thread Nathan Bossart
Convert unloggedLSN to an atomic variable. Currently, this variable is an XLogRecPtr protected by a spinlock. By converting it to an atomic variable, we can remove the spinlock, which saves a small amount of shared memory space. Since this code is not performance-critical, we use atomic

pgsql: Convert archiver's force_dir_scan variable to an atomic variable

2024-02-29 Thread Nathan Bossart
Convert archiver's force_dir_scan variable to an atomic variable. Commit bd5132db55 introduced new atomic read/write functions with full barrier semantics, which are intended to simplify converting non-performance-critical code to use atomic variables. This commit demonstrates one such

pgsql: Introduce atomic read/write functions with full barrier semantic

2024-02-29 Thread Nathan Bossart
Introduce atomic read/write functions with full barrier semantics. Writing correct code using atomic variables is often difficult due to the memory barrier semantics (or lack thereof) of the underlying operations. This commit introduces atomic read/write functions with full barrier semantics to

pgsql: Support MERGE into updatable views.

2024-02-29 Thread Dean Rasheed
Support MERGE into updatable views. This allows the target relation of MERGE to be an auto-updatable or trigger-updatable view, and includes support for WITH CHECK OPTION, security barrier views, and security invoker views. A trigger-updatable view must have INSTEAD OF triggers for every type of

pgsql: Add missing RangeTblEntry field to jumble

2024-02-29 Thread Peter Eisentraut
Add missing RangeTblEntry field to jumble RangeTblEntry.funcordinality should be jumbled, because the WITH ORDINALITY clause changes the query result. This was apparently an oversight in the past. Discussion:

pgsql: Remove field UpdateContext->updated in nodeModifyTable.c

2024-02-29 Thread Dean Rasheed
Remove field UpdateContext->updated in nodeModifyTable.c This field has been redundant ever since it was added by commit 25e777cf8e, which split up ExecUpdate() and ExecDelete() into reusable pieces. The only place that reads it is ExecMergeMatched(), if the result from ExecUpdateAct() is TM_Ok.

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas

pgsql: Fix integer underflow in shared memory debugging

2024-02-29 Thread Daniel Gustafsson
Fix integer underflow in shared memory debugging dsa_dump would print a large negative number instead of zero for segment bin 0. Fix by explicitly checking for underflow and add special case for bin 0. Backpatch to all supported versions. Author: Ian Ilyasov Reviewed-by: Robert Haas