pgsql: Doc: add information about partition locking

2025-04-01 Thread David Rowley
Doc: add information about partition locking The documentation around locking of partitions for the executor startup phase of run-time partition pruning wasn't clear about which partitions were being locked. Fix that. Reviewed-by: Tender Wang Discussion: https://postgr.es/m/CAApHDvp738G75HfkKc

pgsql: Doc: add information about partition locking

2025-04-01 Thread David Rowley
Doc: add information about partition locking The documentation around locking of partitions for the executor startup phase of run-time partition pruning wasn't clear about which partitions were being locked. Fix that. Reviewed-by: Tender Wang Discussion: https://postgr.es/m/CAApHDvp738G75HfkKc

pgsql: Doc: add information about partition locking

2025-04-01 Thread David Rowley
Doc: add information about partition locking The documentation around locking of partitions for the executor startup phase of run-time partition pruning wasn't clear about which partitions were being locked. Fix that. Reviewed-by: Tender Wang Discussion: https://postgr.es/m/CAApHDvp738G75HfkKc

pgsql: Doc: add information about partition locking

2025-04-01 Thread David Rowley
Doc: add information about partition locking The documentation around locking of partitions for the executor startup phase of run-time partition pruning wasn't clear about which partitions were being locked. Fix that. Reviewed-by: Tender Wang Discussion: https://postgr.es/m/CAApHDvp738G75HfkKc

pgsql: Doc: add information about partition locking

2025-04-01 Thread David Rowley
Doc: add information about partition locking The documentation around locking of partitions for the executor startup phase of run-time partition pruning wasn't clear about which partitions were being locked. Fix that. Reviewed-by: Tender Wang Discussion: https://postgr.es/m/CAApHDvp738G75HfkKc

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-01 Thread Michael Paquier
On Mar 31, 2025, at 3:12, Jeff Davis wrote: > Why pg_strdup() the "NULL" at all in that case? Usually I see that done > so that there doesn't need to be a conditional when freeing, but here > there's a conditional anyway. > > Perhaps something like the attached? This would work for me as well. I

pgsql: Fix planner's failure to identify multiple hashable ScalarArrayO

2025-04-01 Thread David Rowley
Fix planner's failure to identify multiple hashable ScalarArrayOpExprs 50e17ad28 (v14) and 29f45e299 (v15) made it so the planner could identify IN and NOT IN clauses which have Const lists as right-hand arguments and when an appropriate hash function is available for the data types, mark the Scal

pgsql: Fix planner's failure to identify multiple hashable ScalarArrayO

2025-04-01 Thread David Rowley
Fix planner's failure to identify multiple hashable ScalarArrayOpExprs 50e17ad28 (v14) and 29f45e299 (v15) made it so the planner could identify IN and NOT IN clauses which have Const lists as right-hand arguments and when an appropriate hash function is available for the data types, mark the Scal

pgsql: Fix planner's failure to identify multiple hashable ScalarArrayO

2025-04-01 Thread David Rowley
Fix planner's failure to identify multiple hashable ScalarArrayOpExprs 50e17ad28 (v14) and 29f45e299 (v15) made it so the planner could identify IN and NOT IN clauses which have Const lists as right-hand arguments and when an appropriate hash function is available for the data types, mark the Scal

pgsql: Fix planner's failure to identify multiple hashable ScalarArrayO

2025-04-01 Thread David Rowley
Fix planner's failure to identify multiple hashable ScalarArrayOpExprs 50e17ad28 (v14) and 29f45e299 (v15) made it so the planner could identify IN and NOT IN clauses which have Const lists as right-hand arguments and when an appropriate hash function is available for the data types, mark the Scal

pgsql: Introduce a SQL-callable function array_sort(anyarray).

2025-04-01 Thread Tom Lane
Introduce a SQL-callable function array_sort(anyarray). Create a function that will sort the elements of an array according to the element type's sort order. If the array has more than one dimension, the sub-arrays of the first dimension are sorted per normal array-comparison rules, leaving their

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: aio: Minor comment improvements

2025-04-01 Thread Andres Freund
aio: Minor comment improvements Reviewed-by: Noah Misch Discussion: https://postgr.es/m/usbwzckj7q3jhfx3ann3nrfnukmupbs35axvq5zfyeo6nvrzrm@onjhxs2du4st Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e19dc74491e68e1df05c99c4937929cef3092a3b Modified Files ---

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: Fix detection and handling of strchrnul() for macOS 15.4.

2025-04-01 Thread Tom Lane
Fix detection and handling of strchrnul() for macOS 15.4. As of 15.4, macOS has strchrnul(), but access to it is blocked behind a check for MACOSX_DEPLOYMENT_TARGET >= 15.4. But our does-it-link configure check finds it, so we try to use it, and fail with the present default deployment target (na

pgsql: Use workaround of __builtin_setjmp only on MINGW on MSVCRT

2025-04-01 Thread Andrew Dunstan
Use workaround of __builtin_setjmp only on MINGW on MSVCRT MSVCRT is not present Windows/ARM64 and the workaround is not necessary on any UCRT based toolchain. Author: Lars Kanis Discussion: https://postgr.es/m/cahxcyb2ojnhtogvkyxtxmw4b3buxwjx6m-lcp1kcmcrumlo...@mail.gmail.com Branch -- m

pgsql: aio: Add README.md explaining higher level design

2025-04-01 Thread Andres Freund
aio: Add README.md explaining higher level design Reviewed-by: Noah Misch Reviewed-by: Heikki Linnakangas Discussion: https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62irg4dt Discussion: https://postgr.es/m/20210223100344.llw5an2akleng...@alap3.anarazel.de Discussi

pgsql: aio: Add test_aio module

2025-04-01 Thread Andres Freund
aio: Add test_aio module To make the tests possible, a few functions from bufmgr.c/localbuf.c had to be exported, via buf_internals.h. Reviewed-by: Noah Misch Co-authored-by: Andres Freund Co-authored-by: Nazir Bilal Yavuz Discussion: https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadpt

pgsql: md: Add comment & assert to buffer-zeroing path in md[start]read

2025-04-01 Thread Andres Freund
md: Add comment & assert to buffer-zeroing path in md[start]readv() mdreadv() has a codepath to zero out buffers when a read returns zero bytes, guarded by a check for zero_damaged_pages || InRecovery. The InRecovery codepath to zero out buffers in mdreadv() appears to be unreachable. The only kn

pgsql: docs: Add acronym and glossary entries for I/O and AIO

2025-04-01 Thread Andres Freund
docs: Add acronym and glossary entries for I/O and AIO These are fairly basic, but better than nothing. While there are several opportunities to link to these entries, this patch does not add any. They will however be referenced by future patches. Reviewed-by: Noah Misch Discussion: https://pos

pgsql: aio: Add pg_aios view

2025-04-01 Thread Andres Freund
aio: Add pg_aios view The new view lists all IO handles that are currently in use and is mainly useful for PG developers, but may also be useful when tuning PG. Bumps catversion. Reviewed-by: Noah Misch Discussion: https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62

pgsql: Verify roundtrip dump/restore of regression database

2025-04-01 Thread Álvaro Herrera
Verify roundtrip dump/restore of regression database Add a test to pg_upgrade's test suite that verifies that dump-restore-dump of regression database produces equivalent output to dumping it directly. This was already being tested by running pg_upgrade itself, but non-binary-upgrade mode was not

Re: pgsql: Allow parallel CREATE INDEX for GIN indexes

2025-04-01 Thread Peter Eisentraut
On 07.03.25 22:22, Peter Eisentraut wrote: The new tuplesort_getgintuple() in tuplesortvariants.c has a branch that does "return false" even though the function's return type is GinTuple *.  That is probably a mistake.  Check please. Also, this code contains a "pgrminclude ignore", but we don'

pgsql: Remove a stray "pgrminclude" annotation

2025-04-01 Thread Peter Eisentraut
Remove a stray "pgrminclude" annotation We don't use those anymore. Fix for commit 8492feb98f6. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/764d501d24baab8ead6dc3bf7bb0dbd13ea86084 Modified Files -- src/backend/access/gin/gininsert.c | 2 +- 1 file

pgsql: Fix minor C type confusion

2025-04-01 Thread Peter Eisentraut
Fix minor C type confusion Returning false instead of NULL gets a compiler error under gcc-14 -std=gnu23, and it appears to have been unintentional. Fix for commit 8492feb98f6. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/113ecf1f8c8c783d4c5ffb4ff934fcb441b3bc2a

pgsql: heapam: Only set tuple's block once per page in pagemode

2025-04-01 Thread Heikki Linnakangas
heapam: Only set tuple's block once per page in pagemode Due to splitting the block id into two 16 bit integers, BlockIdSet() is more expensive than one might think. Doing it once per returned tuple shows up as a small but reliably reproducible cost. It's simple enough to set the block number ju