pgsql: Re-disallow Memoize for parameterized nested loops with join fil

2024-01-22 Thread David Rowley
Re-disallow Memoize for parameterized nested loops with join filters This was previously fixed in 9e215378d but got broken again as a result of 2489d76c4. It seems that commit causes ppi_clauses to contain duplicate clauses and it's no longer safe to check the list_length of that list to determin

pgsql: Re-disallow Memoize for parameterized nested loops with join fil

2024-01-22 Thread David Rowley
Re-disallow Memoize for parameterized nested loops with join filters This was previously fixed in 9e215378d but got broken again as a result of 2489d76c4. It seems that commit causes ppi_clauses to contain duplicate clauses and it's no longer safe to check the list_length of that list to determin

pgsql: Make documentation builds reproducible

2024-01-22 Thread Peter Eisentraut
Make documentation builds reproducible Currently, the documentation builds are not fully reproducible (in the sense of https://reproducible-builds.org/). A fix is available upstream (https://github.com/docbook/xslt10-stylesheets/issues/54) but not released. This commit patches the upstream fix i

pgsql: Test EXPLAIN (FORMAT JSON) ... XMLTABLE

2024-01-22 Thread Alvaro Herrera
Test EXPLAIN (FORMAT JSON) ... XMLTABLE Also, add an alias to the XMLTABLE expression in an existing test. This covers some code in explain.c that wasn't previously covered. I patched xml_2.out blindly :-( Discussion: https://postgr.es/m/[email protected] Branch -- m

pgsql: Abort pgbench if script end is reached with an open pipeline

2024-01-22 Thread Alvaro Herrera
Abort pgbench if script end is reached with an open pipeline When a pipeline is opened with \startpipeline and not closed, pgbench will either error on the next transaction with a "already in pipeline mode" error or successfully end if this was the last transaction -- despite not sending anything

pgsql: Abort pgbench if script end is reached with an open pipeline

2024-01-22 Thread Alvaro Herrera
Abort pgbench if script end is reached with an open pipeline When a pipeline is opened with \startpipeline and not closed, pgbench will either error on the next transaction with a "already in pipeline mode" error or successfully end if this was the last transaction -- despite not sending anything

pgsql: Abort pgbench if script end is reached with an open pipeline

2024-01-22 Thread Alvaro Herrera
Abort pgbench if script end is reached with an open pipeline When a pipeline is opened with \startpipeline and not closed, pgbench will either error on the next transaction with a "already in pipeline mode" error or successfully end if this was the last transaction -- despite not sending anything

pgsql: Abort pgbench if script end is reached with an open pipeline

2024-01-22 Thread Alvaro Herrera
Abort pgbench if script end is reached with an open pipeline When a pipeline is opened with \startpipeline and not closed, pgbench will either error on the next transaction with a "already in pipeline mode" error or successfully end if this was the last transaction -- despite not sending anything

pgsql: Fix two memcpy() bugs in the new injection point code

2024-01-22 Thread Heikki Linnakangas
Fix two memcpy() bugs in the new injection point code 1. The memcpy()s in InjectionPointAttach() would copy garbage from beyond the end of input string to the buffer in shared memory. You won't usually notice, but if there is not enough valid mapped memory beyond the end of the string, the read of

pgsql: Fix ERROR message in injection_point.c

2024-01-22 Thread Michael Paquier
Fix ERROR message in injection_point.c This commit fixes an error message that failed to show the correct function and library names when a function cannot be loaded. While on it, adjust the call to load_external_function() so as this ERROR can be reached, by making load_external_function() retur

pgsql: Fix possible NULL pointer dereference in GetNamedDSMSegment().

2024-01-22 Thread Nathan Bossart
Fix possible NULL pointer dereference in GetNamedDSMSegment(). GetNamedDSMSegment() doesn't check whether dsm_attach() returns NULL, which creates the possibility of a NULL pointer dereference soon after. To fix, emit an ERROR if dsm_attach() returns NULL. This shouldn't happen, but it would be n

pgsql: ci: Enable injection points in builds

2024-01-22 Thread Michael Paquier
ci: Enable injection points in builds --enable-injection-points and -Dinjection_points=true are now given to the commands triggered by the tasks where assertions are enabled, providing coverage for injection points or any test using them. Author: Heikki Linnakangas Discussion: https://postgr.es/m

pgsql: Add better handling of redundant IS [NOT] NULL quals

2024-01-22 Thread David Rowley
Add better handling of redundant IS [NOT] NULL quals Until now PostgreSQL has not been very smart about optimizing away IS NOT NULL base quals on columns defined as NOT NULL. The evaluation of these needless quals adds overhead. Ordinarily, anyone who came complaining about that would likely jus

pgsql: Improve stability of recovery test 035_standby_logical_decoding

2024-01-22 Thread Michael Paquier
Improve stability of recovery test 035_standby_logical_decoding This commit tweaks a couple of things in 035_standby_logical_decoding to hopefully stabilize it: - Autovacuum is now disabled, as it could hold a global xmin with a transaction. - Conflicts are generated with command sequences that re

pgsql: Improve stability of recovery test 035_standby_logical_decoding

2024-01-22 Thread Michael Paquier
Improve stability of recovery test 035_standby_logical_decoding This commit tweaks a couple of things in 035_standby_logical_decoding to hopefully stabilize it: - Autovacuum is now disabled, as it could hold a global xmin with a transaction. - Conflicts are generated with command sequences that re

pgsql: Generate syscache info from catalog files

2024-01-22 Thread Peter Eisentraut
Generate syscache info from catalog files Add a new genbki macros MAKE_SYSCACHE that specifies the syscache ID macro, the underlying index, and the number of buckets. From that, we can generate the existing tables in syscache.h and syscache.c via genbki.pl. Reviewed-by: John Naylor Discussion: