pgsql: Use more palloc_object() and palloc_array() in contrib/

2025-12-04 Thread Michael Paquier
Use more palloc_object() and palloc_array() in contrib/ The idea is to encourage more the use of these new routines across the tree, as these offer stronger type safety guarantees than palloc(). In an ideal world, palloc() would then act as an internal routine of these flavors, whose footprint in

pgsql: Improve test output of extended statistics for ndistinct and dep

2025-12-04 Thread Michael Paquier
Improve test output of extended statistics for ndistinct and dependencies Corey Huinker has come up with a recipe that is more compact and more pleasant to the eye for extended stats because we know that all of them are 1-dimension JSON arrays. This commit switches the extended stats tests to use

pgsql: Rename column slotsync_skip_at to slotsync_last_skip.

2025-12-04 Thread Amit Kapila
Rename column slotsync_skip_at to slotsync_last_skip. Commit 76b78721ca introduced two new columns in pg_stat_replication_slots to improve monitoring of slot synchronization. One of these columns was named slotsync_skip_at, which is inconsistent with the naming convention used for similar columns

pgsql: Fix some compiler warnings

2025-12-04 Thread Michael Paquier
Fix some compiler warnings Some of the buildfarm members with some old gcc versions have been complaining about an always-true test for a NULL pointer caused by a combination of SOFT_ERROR_OCCURRED() and a local ErrorSaveContext variable. These warnings are taken care of by removing SOFT_ERROR_OC

pgsql: Show version of nodes in output of TAP tests

2025-12-04 Thread Michael Paquier
Show version of nodes in output of TAP tests This commit adds the version information of a node initialized by Cluster.pm, that may vary depending on the install_path given by the test. The code was written so as the node information, that includes the version number, was dumped before the versio

pgsql: Show version of nodes in output of TAP tests

2025-12-04 Thread Michael Paquier
Show version of nodes in output of TAP tests This commit adds the version information of a node initialized by Cluster.pm, that may vary depending on the install_path given by the test. The code was written so as the node information, that includes the version number, was dumped before the versio

pgsql: Show version of nodes in output of TAP tests

2025-12-04 Thread Michael Paquier
Show version of nodes in output of TAP tests This commit adds the version information of a node initialized by Cluster.pm, that may vary depending on the install_path given by the test. The code was written so as the node information, that includes the version number, was dumped before the versio

pgsql: Show version of nodes in output of TAP tests

2025-12-04 Thread Michael Paquier
Show version of nodes in output of TAP tests This commit adds the version information of a node initialized by Cluster.pm, that may vary depending on the install_path given by the test. The code was written so as the node information, that includes the version number, was dumped before the versio

pgsql: Show version of nodes in output of TAP tests

2025-12-04 Thread Michael Paquier
Show version of nodes in output of TAP tests This commit adds the version information of a node initialized by Cluster.pm, that may vary depending on the install_path given by the test. The code was written so as the node information, that includes the version number, was dumped before the versio

pgsql: Suppress spurious Coverity warning in prune freeze logic

2025-12-04 Thread Melanie Plageman
Suppress spurious Coverity warning in prune freeze logic Adjust the prune_freeze_setup() parameter types of new_relfrozen_xid and new_relmin_mxid to prevent misleading Coverity analysis. heap_page_prune_and_freeze() compared these values against NULL when passing them to prune_freeze_setup(), caus

pgsql: Fix key size of PrivateRefCountHash.

2025-12-04 Thread Nathan Bossart
Fix key size of PrivateRefCountHash. The key is the first member of PrivateRefCountEntry, which has type Buffer. This commit changes the key size from sizeof(int32) to sizeof(Buffer). This appears to be an oversight in commit 4b4b680c3d, but it's of no consequence because Buffer has been a signe

pgsql: Remove no longer needed casts from Pointer

2025-12-04 Thread Peter Eisentraut
Remove no longer needed casts from Pointer These casts used to be required when Pointer was char *, but now it's void * (commit 1b2bb5077e9), so they are not needed anymore. Author: Dagfinn Ilmari Mannsåker Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%4

pgsql: Remove no longer needed casts to Pointer

2025-12-04 Thread Peter Eisentraut
Remove no longer needed casts to Pointer These casts used to be required when Pointer was char *, but now it's void * (commit 1b2bb5077e9), so they are not needed anymore. Reviewed-by: Chao Li Reviewed-by: Bertrand Drouvot Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd

pgsql: amcheck: Fix snapshot usage in bt_index_parent_check

2025-12-04 Thread Álvaro Herrera
amcheck: Fix snapshot usage in bt_index_parent_check We were using SnapshotAny to do some index checks, but that's wrong and causes spurious errors when used on indexes created by CREATE INDEX CONCURRENTLY. Fix it to use an MVCC snapshot, and add a test for it. This problem came in with commit 5

pgsql: amcheck: Fix snapshot usage in bt_index_parent_check

2025-12-04 Thread Álvaro Herrera
amcheck: Fix snapshot usage in bt_index_parent_check We were using SnapshotAny to do some index checks, but that's wrong and causes spurious errors when used on indexes created by CREATE INDEX CONCURRENTLY. Fix it to use an MVCC snapshot, and add a test for it. This problem came in with commit 5

pgsql: amcheck: Fix snapshot usage in bt_index_parent_check

2025-12-04 Thread Álvaro Herrera
amcheck: Fix snapshot usage in bt_index_parent_check We were using SnapshotAny to do some index checks, but that's wrong and causes spurious errors when used on indexes created by CREATE INDEX CONCURRENTLY. Fix it to use an MVCC snapshot, and add a test for it. This problem came in with commit 5

pgsql: headerscheck ccache support

2025-12-04 Thread Peter Eisentraut
headerscheck ccache support Currently, headerscheck and cpluspluscheck are very slow, and they defeat use of ccache. This fixes that, and now they are much faster. The problem was that the test files are created in a randomly-named directory (`mktemp -d /tmp/$me.XX`), and this directory is m

pgsql: headerscheck: Use LLVM_CPPFLAGS

2025-12-04 Thread Peter Eisentraut
headerscheck: Use LLVM_CPPFLAGS Otherwise, headerscheck will fail if the LLVM headers are in a location not reached by the normal CFLAGS/CPPFLAGS. Discussion: https://www.postgresql.org/message-id/flat/b49e74d4-3cf9-4d1c-9dce-09f75e55d026%40eisentraut.org Branch -- master Details --- h

pgsql: Fix incorrect assertion bound in WaitForLSN()

2025-12-04 Thread Alexander Korotkov
Fix incorrect assertion bound in WaitForLSN() The assertion checking MyProcNumber used MaxBackends as the upper bound, but the procInfos array is allocated with size MaxBackends + NUM_AUXILIARY_PROCS. This inconsistency would cause a false assertion failure if an auxiliary process calls WaitForLSN