pgsql: Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS

2025-10-21 Thread Tatsuo Ishii
Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS. Previously it was mistakenly assumed that there's only one window function argument which needs to be processed by WinGetFuncArgInFrame or WinGetFuncArgInPartition when IGNORE NULLS option is specified. To eliminate the limitation,

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Fix stalled lag columns in pg_stat_replication when replay LSN s

2025-10-21 Thread Fujii Masao
Fix stalled lag columns in pg_stat_replication when replay LSN stops advancing. Previously, when the replay LSN reported in feedback messages from a standby stopped advancing, for example, due to a recovery conflict, the write_lag and flush_lag columns in pg_stat_replication would initially update

pgsql: Bump catalog version for new function error_on_null()

2025-10-21 Thread Michael Paquier
Bump catalog version for new function error_on_null() Oversight in 2b75c38b707a. No comments. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2519fa836235d371a6d7f5c2eb3a8f379120a988 Modified Files

pgsql: Add error_on_null(), checking if the input is the null value

2025-10-21 Thread Michael Paquier
Add error_on_null(), checking if the input is the null value This polymorphic function produces an error if the input value is detected as being the null value; otherwise it returns the input value unchanged. This function can for example become handy in SQL function bodies, to enforce that exact

pgsql: Use CompactAttribute more often, when possible

2025-10-21 Thread David Rowley
Use CompactAttribute more often, when possible 5983a4cff added CompactAttribute for storing commonly used fields from FormData_pg_attribute. 5983a4cff didn't go to the trouble of adjusting every location where we can use CompactAttribute rather than FormData_pg_attribute, so here we change the re

pgsql: Add .abi-compliance-history to back-branches.

2025-10-21 Thread Nathan Bossart
Add .abi-compliance-history to back-branches. This file was previously added to v18 by commits a72f7d97be and 93fb76ca4e. Unlike the v18 version of the file, the back-branch versions set the original baseline point to the most recent ABI break documented in the git commit history. While we'd ord

pgsql: Add .abi-compliance-history to back-branches.

2025-10-21 Thread Nathan Bossart
Add .abi-compliance-history to back-branches. This file was previously added to v18 by commits a72f7d97be and 93fb76ca4e. Unlike the v18 version of the file, the back-branch versions set the original baseline point to the most recent ABI break documented in the git commit history. While we'd ord

pgsql: Add .abi-compliance-history to back-branches.

2025-10-21 Thread Nathan Bossart
Add .abi-compliance-history to back-branches. This file was previously added to v18 by commits a72f7d97be and 93fb76ca4e. Unlike the v18 version of the file, the back-branch versions set the original baseline point to the most recent ABI break documented in the git commit history. While we'd ord

pgsql: Add .abi-compliance-history to back-branches.

2025-10-21 Thread Nathan Bossart
Add .abi-compliance-history to back-branches. This file was previously added to v18 by commits a72f7d97be and 93fb76ca4e. Unlike the v18 version of the file, the back-branch versions set the original baseline point to the most recent ABI break documented in the git commit history. While we'd ord

pgsql: Add .abi-compliance-history to back-branches.

2025-10-21 Thread Nathan Bossart
Add .abi-compliance-history to back-branches. This file was previously added to v18 by commits a72f7d97be and 93fb76ca4e. Unlike the v18 version of the file, the back-branch versions set the original baseline point to the most recent ABI break documented in the git commit history. While we'd ord

pgsql: Avoid short seeks in pg_restore.

2025-10-21 Thread Tom Lane
Avoid short seeks in pg_restore. If a data block to be skipped over is less than 4kB, just read the data instead of using fseeko(). Experimentation shows that this avoids useless kernel calls --- possibly quite a lot of them, at least with current glibc --- while not incurring any extra I/O, sinc

pgsql: Add reminder to create .abi-compliance-history.

2025-10-21 Thread Nathan Bossart
Add reminder to create .abi-compliance-history. This commit adds a note to RELEASE_CHANGES to remind us to create an .abi-compliance-history file for new major versions. Reviewed-by: Tom Lane Reviewed-by: David E. Wheeler Discussion: https://postgr.es/m/aPJ03E2itovDBcKX%40nathan Branch --

pgsql: Update .abi-compliance-history file.

2025-10-21 Thread Nathan Bossart
Update .abi-compliance-history file. As foretold by commit a72f7d97be, this commit moves the baseline point for ABI compatibility for v18 to commit c8af5019be. While at it, add some more commentary and adjust the format of the entries to improve both human and machine readability. There's a good

pgsql: Make char2wchar() static.

2025-10-21 Thread Jeff Davis
Make char2wchar() static. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ff53907c35713a9c0c8cbdcc8d82c54954cf8234 Modified Files

pgsql: tsearch: use database default collation for parsing.

2025-10-21 Thread Jeff Davis
tsearch: use database default collation for parsing. Previously, tsearch used the database's CTYPE setting, which only matches the database default collation if the locale provider is libc. Note that tsearch types (tsvector and tsquery) are not collatable types. The locale affects parsing the ori

pgsql: Remove obsolete global database_ctype_is_c.

2025-10-21 Thread Jeff Davis
Remove obsolete global database_ctype_is_c. Now that tsearch uses the database default locale, there's no need to track the database CTYPE separately. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c70341ed7a54899667eee9a4a83d8eaaa763e7d9 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f9790ac5464da45eb44470ab831584356381597b Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c0897125171035e4d4b9fc8cf8a099131ac45281 Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/2795f5a5428fd292996fd155f16a57b0db3df8f4 Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e94a7afe44bfa1bd8dc929204a2d4ac8b3fa9854 Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3f1ef7dcc2cb25c9c6d0c54d35713298ebe6fcbc Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e9514a2f73162578fd53d391dd6eff4359c82b61 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b797c2854964cc1a940a8ea2bb7ce2dc04401129 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d1469c21437129932cda9c81e348fd22c7530fa5 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/bcc6e13570c714a5dc14f8fcfbd5c33300a320d1 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e95010a9c0bad33cca21d762dd1151167993fd37 Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Re-pgindent brin.c.

2025-10-21 Thread Nathan Bossart
Re-pgindent brin.c. Backpatch-through: 13 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/63a5b1f89423f003ec850eee270c40b30b87cd52 Modified Files -- src/backend/access/brin/brin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/776c2c2ae2d3ba7d9b5d7d780df67af1924e7591 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Add previous commit to .git-blame-ignore-revs.

2025-10-21 Thread Nathan Bossart
Add previous commit to .git-blame-ignore-revs. Backpatch-through: 13 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0a358eb45ed4ab44397bcf6aad20bae9be28c057 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

Re: pgsql: Fix thinko in commit 7d129ba54.

2025-10-21 Thread Daniel Gustafsson
> On 20 Oct 2025, at 14:46, Tom Lane wrote: > > Fix thinko in commit 7d129ba54. Ugh, I missed this buildfarm breakage =( I apologise for the oversight and thanks for fixing! -- Daniel Gustafsson

pgsql: Fix comment in pg_get_shmem_allocations_numa()

2025-10-21 Thread Michael Paquier
Fix comment in pg_get_shmem_allocations_numa() The comment fixed in this commit described the function as dealing with database blocks, but in reality it processes shared memory allocations. Author: Bertrand Drouvot Discussion: https://postgr.es/m/[email protected]

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Make smgr access for a BufferManagerRelation safer in relcache i

2025-10-21 Thread Álvaro Herrera
Make smgr access for a BufferManagerRelation safer in relcache inval Currently there's no bug, because we have no code path where we invalidate relcache entries where it'd cause a problem. But it's more robust to do it this way in case we introduce such a path later, as some Postgres forks report

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix BRIN 32-bit counter wrap issue with huge tables

2025-10-21 Thread David Rowley
Fix BRIN 32-bit counter wrap issue with huge tables A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange to when the table contains close to 2^32 pages. At worst, this could result in a cancellable infinite loop during the BRIN index scan with power-of-2 pagesPerRange, and slo

pgsql: Fix comment in pg_get_shmem_allocations_numa()

2025-10-21 Thread Michael Paquier
Fix comment in pg_get_shmem_allocations_numa() The comment fixed in this commit described the function as dealing with database blocks, but in reality it processes shared memory allocations. Author: Bertrand Drouvot Discussion: https://postgr.es/m/[email protected]