pgsql: pgbench: Add \syncpipeline

2024-01-23 Thread Michael Paquier
pgbench: Add \syncpipeline This change adds a new meta-command called \syncpipeline to pgbench, able to send a sync message without flushing using the new libpq function PQsendPipelineSync(). This meta-command is available within a block made of \startpipeline and \endpipeline. Author: Anthonin

pgsql: Adjust populate_record_field() to handle errors softly

2024-01-23 Thread Amit Langote
Adjust populate_record_field() to handle errors softly This adds a Node *escontext parameter to it and a bunch of functions downstream to it, replacing any ereport()s in that path by either errsave() or ereturn() as appropriate. This also adds code to those functions where necessary to return

pgsql: Refactor code used by jsonpath executor to fetch variables

2024-01-23 Thread Amit Langote
Refactor code used by jsonpath executor to fetch variables Currently, getJsonPathVariable() directly extracts a named variable/key from the source Jsonb value. This commit puts that logic into a callback function called by getJsonPathVariable(). Other implementations of the callback may accept

pgsql: Add soft error handling to some expression nodes

2024-01-23 Thread Amit Langote
Add soft error handling to some expression nodes This adjusts the code for CoerceViaIO and CoerceToDomain expression nodes to handle errors softly. For CoerceViaIo, this adds a new ExprEvalStep opcode EEOP_IOCOERCE_SAFE, which is implemented in the new accompanying function

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix crash in autoprewarm.

2024-01-23 Thread Nathan Bossart
Fix crash in autoprewarm. Commit abb0b4fc03 moved the shared state for autoprewarm to a dynamic shared memory (DSM) segment, but it left apw_detach_shmem() in the on_shmem_exit callback list for the autoprewarm leader process. This is a problem because shmem_exit() detaches all the DSM segments

pgsql: Support shared libraries on Android (using make)

2024-01-23 Thread Peter Eisentraut
Support shared libraries on Android (using make) While the rest of the make build system maps Android to Linux, Android uses unversioned shared libraries (like "libpq.so"). This patch makes it so. (Meson already supported it.) Reported-by: Matthias Kuhn Discussion:

pgsql: meson: Map host_system android to linux

2024-01-23 Thread Peter Eisentraut
meson: Map host_system android to linux This appears to be what is missing to support builds on Android (with meson). Author: Andres Freund Discussion: https://www.postgresql.org/message-id/flat/CAC7zN94TdsHhY88XkroJzSMx7E%3DBQpV9LKKjNSEnTM04ihoWCA%40mail.gmail.com Branch -- master

Re: pgsql: Generate syscache info from catalog files

2024-01-23 Thread Tom Lane
Peter Eisentraut writes: > On 23.01.24 15:08, Tom Lane wrote: >> Per guaibasaurus[1], this commit broke "make dist": >> I'm not sure why --- the makefile changes treat these new files >> exactly like other generated files. It doesn't repro here, >> either, which is odd. It looks like a timing

pgsql: Fix makefiles for newly added files

2024-01-23 Thread Peter Eisentraut
Fix makefiles for newly added files The new files added in 9b1a6f50b9 need to be mentioned in a few more places in the makefiles. Discussion: https://www.postgresql.org/message-id/flat/E1rSAY2-002hIk-4y%40gemulon.postgresql.org Branch -- master Details ---

Re: pgsql: Generate syscache info from catalog files

2024-01-23 Thread Peter Eisentraut
On 23.01.24 15:08, Tom Lane wrote: Peter Eisentraut writes: Generate syscache info from catalog files Per guaibasaurus[1], this commit broke "make dist": ... rm -rf tmp_install/ portlock/ rm -f config.cache config.log config.status GNUmakefile make[1]: Leaving directory

Re: pgsql: Generate syscache info from catalog files

2024-01-23 Thread Tom Lane
I wrote: > Peter Eisentraut writes: >> Generate syscache info from catalog files > Per guaibasaurus[1], this commit broke "make dist": > ... > I'm not sure why --- the makefile changes treat these new files > exactly like other generated files. It doesn't repro here, > either, which is odd. It

Re: pgsql: Generate syscache info from catalog files

2024-01-23 Thread Tom Lane
Peter Eisentraut writes: > Generate syscache info from catalog files Per guaibasaurus[1], this commit broke "make dist": ... rm -rf tmp_install/ portlock/ rm -f config.cache config.log config.status GNUmakefile make[1]: Leaving directory

pgsql: doc: Add acronym and glossary term for Access Method

2024-01-23 Thread Daniel Gustafsson
doc: Add acronym and glossary term for Access Method AM was used throughout the documentation to denote Access Method, but the acronym was not described. This adds an acronym entry as well as a glossary term which the acronym links to. Each page which describe AMs have the first occurrence with

pgsql: meson: portname was set too early

2024-01-23 Thread Peter Eisentraut
meson: portname was set too early portname is set to host_system, but host_system might still be changed later in the file. As a consequence, platforms where host_system is changed later wouldn't find some of their platform-specific files (driven by portname), and the build would fail. Move the

pgsql: meson: portname was set too early

2024-01-23 Thread Peter Eisentraut
meson: portname was set too early portname is set to host_system, but host_system might still be changed later in the file. As a consequence, platforms where host_system is changed later wouldn't find some of their platform-specific files (driven by portname), and the build would fail. Move the

pgsql: Revert "libpqwalreceiver: Convert to libpq-be-fe-helpers.h"

2024-01-23 Thread Heikki Linnakangas
Revert "libpqwalreceiver: Convert to libpq-be-fe-helpers.h" This reverts commit 728f86fec65537eade8d9e751961782ddb527934. The signal handling was a few bricks shy of a load in that commit, which made the walreceiver non-responsive to SIGTERM while it was waiting for the connection to be

pgsql: Revert "libpqwalreceiver: Convert to libpq-be-fe-helpers.h"

2024-01-23 Thread Heikki Linnakangas
Revert "libpqwalreceiver: Convert to libpq-be-fe-helpers.h" This reverts commit 728f86fec65537eade8d9e751961782ddb527934. The signal handling was a few bricks shy of a load in that commit, which made the walreceiver non-responsive to SIGTERM while it was waiting for the connection to be