pgsql: Add TAP tests for ZLIB compression for pg_receivewal

2021-07-14 Thread Michael Paquier
Add TAP tests for ZLIB compression for pg_receivewal There is a non-trivial amount of code that handles ZLIB compression in pg_receivewal, from basics like the format name, the calculation of the start streaming position and of course the compression itself, but there was no automated coverage for

pgsql: Remove unnecessary assertion in postmaster.c

2021-07-14 Thread Michael Paquier
Remove unnecessary assertion in postmaster.c A code path asserted that the archiver was dead, but a check made that impossible to happen. Author: Bharath Rupireddy Discussion: https://postgr.es/m/CALj2ACW=CYE1ars+2XyPTEPq0wQvru4c0dPZ=nrn3eqnbkk...@mail.gmail.com Backpatch-throgh: 14 Branch

pgsql: Remove unnecessary assertion in postmaster.c

2021-07-14 Thread Michael Paquier
Remove unnecessary assertion in postmaster.c A code path asserted that the archiver was dead, but a check made that impossible to happen. Author: Bharath Rupireddy Discussion: https://postgr.es/m/CALj2ACW=CYE1ars+2XyPTEPq0wQvru4c0dPZ=nrn3eqnbkk...@mail.gmail.com Backpatch-throgh: 14 Branch

Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.

2021-07-14 Thread Thomas Munro
On Thu, Jul 15, 2021 at 4:07 AM Tom Lane wrote: > I've tested the attached on the GCC farm's Solaris machine (which > I believe is the same machine wrasse runs on), and it seems OK. > I think it's ready to go. Pushed. Thanks!

pgsql: Portability fixes for sigwait.

2021-07-14 Thread Thomas Munro
Portability fixes for sigwait. Build farm animals running ancient HPUX and Solaris have a non-standard sigwait() from draft versions of POSIX, so they didn't like commit 7c09d279. To avoid the problem in general, only try to use sigwait() if it's declared by and matches the expected declaration.

pgsql: Fix some nonstandard C code indentation in grammar file

2021-07-14 Thread Peter Eisentraut
Fix some nonstandard C code indentation in grammar file Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9aa8268faa0ec2904f55e85be5ec7b365c98edd1 Modified Files -- src/backend/parser/gram.y | 44 ++-- 1 file changed,

pgsql: Copy a Param's location field when replacing it with a Const.

2021-07-14 Thread Tom Lane
Copy a Param's location field when replacing it with a Const. This allows Param substitution to produce just the same result as writing a constant value literally would have done. While it hardly matters so far as the current core code is concerned, extensions might take more interest in node loc

Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.

2021-07-14 Thread Tom Lane
Thomas Munro writes: > I decided to try to make it work properly on that OS instead of the > hacky solution now that I have access. I took your last patch, moved > -D_POSIX_PTHREAD_SEMANTICS into CFLAGS in src/template/solaris, Aha! Yeah, just defining _POSIX_PTHREAD_SEMANTICS unconditionally o

pgsql: Remove unused function parameter in get_qual_from_partbound

2021-07-14 Thread John Naylor
Remove unused function parameter in get_qual_from_partbound Commit 0563a3a8b changed how partition constraints were generated such that this function no longer computes the mapping of parent attnos to child attnos. This is an external function that extensions could use, so this is potentially a b

Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.

2021-07-14 Thread Thomas Munro
On Wed, Jul 14, 2021 at 4:08 PM Thomas Munro wrote: > On Wed, Jul 14, 2021 at 6:17 AM Tom Lane wrote: > > (I suppose a hacky solution might be to never define USE_SIGWAIT > > on Solaris.) > > Yeah I was thinking about that. I've just got a shell on an illumos > VM and will try a couple of ideas

pgsql: In psql \copy from, send data to server in larger chunks.

2021-07-14 Thread Heikki Linnakangas
In psql \copy from, send data to server in larger chunks. Previously, we would send each line as a separate CopyData message. That's pretty wasteful if the table is narrow, as each CopyData message has 5 bytes of overhead. For efficiency, buffer up and pack 8 kB of input data into each CopyData me

pgsql: Clarify description of pg_stat_statements columns

2021-07-14 Thread Magnus Hagander
Clarify description of pg_stat_statements columns Reported-By: Peter Eisentraut Backpatch-through: 14 Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b4deefc39b933b9808645667117f2

pgsql: Clarify description of pg_stat_statements columns

2021-07-14 Thread Magnus Hagander
Clarify description of pg_stat_statements columns Reported-By: Peter Eisentraut Backpatch-through: 14 Discussion: https://postgr.es/m/[email protected] Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3b57d5af7435d0d21bdec3

pgsql: Add support for prepared transactions to built-in logical replic

2021-07-14 Thread Amit Kapila
Add support for prepared transactions to built-in logical replication. To add support for streaming transactions at prepare time into the built-in logical replication, we need to do the following things: * Modify the output plugin (pgoutput) to implement the new two-phase API callbacks, by levera

pgsql: Fix unexpected error messages for various flavors of ALTER TABLE

2021-07-14 Thread Michael Paquier
Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate

pgsql: Fix unexpected error messages for various flavors of ALTER TABLE

2021-07-14 Thread Michael Paquier
Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate

pgsql: Fix unexpected error messages for various flavors of ALTER TABLE

2021-07-14 Thread Michael Paquier
Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate

pgsql: Fix unexpected error messages for various flavors of ALTER TABLE

2021-07-14 Thread Michael Paquier
Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate

pgsql: Fix lack of message pluralization

2021-07-14 Thread Peter Eisentraut
Fix lack of message pluralization Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b4842a8d085e970ff24667954c0d861e911e16c1 Modified Files -- src/backend/storage/ipc/signalfuncs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)

pgsql: Fix lack of message pluralization

2021-07-14 Thread Peter Eisentraut
Fix lack of message pluralization Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/55b2a2340758da8ff11357d719d169f264ac7112 Modified Files -- src/backend/storage/ipc/signalfuncs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)