pgsql: plpgsql: pure parser and reentrant scanner

2025-01-08 Thread Peter Eisentraut
plpgsql: pure parser and reentrant scanner The plpgsql scanner is a wrapper around the core scanner, which already uses the flex %option reentrant. This patch only pushes up a few levels the place where the scanner handle is allocated. Before, it was allocated in pl_scanner.c in a global variabl

pgsql: Fix SLRU bank selection code

2025-01-08 Thread Álvaro Herrera
Fix SLRU bank selection code The originally submitted code (using bit masking) was correct when the number of slots was restricted to be a power of two -- but that limitation was removed during development that led to commit 53c2a97a9266, which made the bank selection code incorrect. This led to

pgsql: Fix SLRU bank selection code

2025-01-08 Thread Álvaro Herrera
Fix SLRU bank selection code The originally submitted code (using bit masking) was correct when the number of slots was restricted to be a power of two -- but that limitation was removed during development that led to commit 53c2a97a9266, which made the bank selection code incorrect. This led to

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Set exit status for pgindent if pg_bsd_indent fails

2025-01-08 Thread Andrew Dunstan
Set exit status for pgindent if pg_bsd_indent fails Also document the exit codes in the script. The new exit code is 3, and is not overridden by the exit code set in --check mode. Author: Ashutosh Bapat Discussion: https://postgr.es/m/[email protected]

pgsql: Disallow NAMEDTUPLESTORE RTEs in stored views, rules, etc.

2025-01-08 Thread Tom Lane
Disallow NAMEDTUPLESTORE RTEs in stored views, rules, etc. A named tuplestore is necessarily a transient object, so it makes no sense to reference one in a persistent object such as a view. We didn't previously prevent that, with the result that if you tried you would get some weird failure about

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Fix off_t overflow in pg_basebackup on Windows.

2025-01-08 Thread Thomas Munro
Fix off_t overflow in pg_basebackup on Windows. walmethods.c used off_t to navigate around a pg_wal.tar file that could exceed 2GB, which doesn't work on Windows and would fail with misleading errors. Use pgoff_t instead. Back-patch to all supported branches. Author: Davinder Singh Reported-by

pgsql: Provide 64-bit ftruncate() and lseek() on Windows.

2025-01-08 Thread Thomas Munro
Provide 64-bit ftruncate() and lseek() on Windows. Change our ftruncate() macro to use the 64-bit variant of chsize(), and add a new macro to redirect lseek() to _lseeki64(). Back-patch to all supported releases, in preparation for a bug fix. Tested-by: Davinder Singh Discussion: https://postg

pgsql: Fix duplicate typedef from commit a2f17f004d.

2025-01-08 Thread Jeff Davis
Fix duplicate typedef from commit a2f17f004d. Reported-by: Thomas Munro Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/229e7793d96954739d3fb9b37e2ccf77c2803f07 Modified Files -- src/include/utils/pg_locale.h | 2 -- 1 file changed, 2 deletions(-)

pgsql: Back-patch b1ffe3ff into REL_13_STABLE.

2025-01-08 Thread Thomas Munro
Back-patch b1ffe3ff into REL_13_STABLE. This is a cherry pick of 4c8e00ae from the 14 branch into the 13 branch. It avoids an assertion failure when ForwardSyncRequest() tries to allocate memory while trying to compact the queue, if run in a critical section. RelationTruncate() gained a critical

pgsql: Move code for collation version into provider-specific files.

2025-01-08 Thread Jeff Davis
Move code for collation version into provider-specific files. Author: Andreas Karlsson Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c477%40proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4f5cef2607c1f8804d4b54250642aaf586745b0e Modified

pgsql: Control collation behavior with a method table.

2025-01-08 Thread Jeff Davis
Control collation behavior with a method table. Previously, behavior branched based on the provider. A method table is less error-prone and more flexible. The ctype behavior will be addressed in an upcoming commit. Reviewed-by: Andreas Karlsson Discussion: https://postgr.es/m/2830211e1b6e6a2e26