pgsql: Delay build of Memoize hash table until executor run

2024-01-29 Thread David Rowley
Delay build of Memoize hash table until executor run Previously this hash table was built during executor startup. This could cause long delays in EXPLAIN (without ANALYZE) when the planner opts to use a large Memoize hash table. No backpatch for now due to lack of complaints. Author: David Row

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Doc: mention foreign keys can reference unique indexes

2024-01-29 Thread David Rowley
Doc: mention foreign keys can reference unique indexes We seem to have only documented a foreign key can reference the columns of a primary key or unique constraint. Here we adjust the documentation to mention columns in a non-partial unique index can be mentioned too. The header comment for tra

pgsql: Move is_valid_ascii() to ascii.h.

2024-01-29 Thread Nathan Bossart
Move is_valid_ascii() to ascii.h. This function requires simd.h, which is a rather large dependency for a widely-used header file like pg_wchar.h. Furthermore, there is a report of a third-party tool that is struggling to use pg_wchar.h due to its dependence on simd.h (presumably because simd.h u

pgsql: Move is_valid_ascii() to ascii.h.

2024-01-29 Thread Nathan Bossart
Move is_valid_ascii() to ascii.h. This function requires simd.h, which is a rather large dependency for a widely-used header file like pg_wchar.h. Furthermore, there is a report of a third-party tool that is struggling to use pg_wchar.h due to its dependence on simd.h (presumably because simd.h u

pgsql: Move is_valid_ascii() to ascii.h.

2024-01-29 Thread Nathan Bossart
Move is_valid_ascii() to ascii.h. This function requires simd.h, which is a rather large dependency for a widely-used header file like pg_wchar.h. Furthermore, there is a report of a third-party tool that is struggling to use pg_wchar.h due to its dependence on simd.h (presumably because simd.h u

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

2024-01-29 Thread Tom Lane
Fix incompatibilities with libxml2 >= 2.12.0. libxml2 changed the required signature of error handler callbacks to make the passed xmlError struct "const". This is causing build failures on buildfarm member caiman, and no doubt will start showing up in the field quite soon. Add a version check t

pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption

2024-01-29 Thread Alvaro Herrera
Add EXPLAIN (MEMORY) to report planner memory consumption This adds a new "Memory:" line under the "Planning:" group (which currently only has "Buffers:") when the MEMORY option is specified. In order to make the reporting reasonably accurate, we create a separate memory context for planner activ

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: Fix locking when fixing an incomplete split of a GIN internal pa

2024-01-29 Thread Heikki Linnakangas
Fix locking when fixing an incomplete split of a GIN internal page ginFinishSplit() expects the caller to hold an exclusive lock on the buffer, but when finishing an earlier "leftover" incomplete split of an internal page, the caller held a shared lock. That caused an assertion failure in MarkBuff

pgsql: libpq: Move cancellation related functions to fe-cancel.c

2024-01-29 Thread Alvaro Herrera
libpq: Move cancellation related functions to fe-cancel.c In follow up commits we'll add more functions related to query cancellations. This groups those all together instead of mixing them with the other functions in fe-connect.c. The formerly static parse_int_param() function had to be exporte