pgsql: Add support for zstd base backup compression.

2022-03-08 Thread Robert Haas
Add support for zstd base backup compression.

Both client-side compression and server-side compression are now
supported for zstd. In addition, a backup compressed by the server
using zstd can now be decompressed by the client in order to
accommodate the use of -Fp.

Jeevan Ladhe, with some edits by me.

Discussion: 
http://postgr.es/m/CA+Tgmobyzfbz=gyze2_ll1zumzunmaekbhqxjrfkor7apzg...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7cf085f077df8dd9b80cf1f5964b5b8c142be496

Modified Files
--
doc/src/sgml/protocol.sgml|   7 +-
doc/src/sgml/ref/pg_basebackup.sgml   |  41 ++--
src/backend/replication/Makefile  |   1 +
src/backend/replication/basebackup.c  |   7 +-
src/backend/replication/basebackup_zstd.c | 299 +++
src/bin/pg_basebackup/Makefile|   1 +
src/bin/pg_basebackup/bbstreamer.h|   3 +
src/bin/pg_basebackup/bbstreamer_zstd.c   | 338 ++
src/bin/pg_basebackup/pg_basebackup.c |  49 +++-
src/bin/pg_basebackup/pg_receivewal.c |   4 +
src/bin/pg_basebackup/walmethods.h|   1 +
src/bin/pg_verifybackup/Makefile  |   1 +
src/bin/pg_verifybackup/t/008_untar.pl|   9 +
src/bin/pg_verifybackup/t/009_extract.pl  |   5 +
src/bin/pg_verifybackup/t/010_client_untar.pl |   8 +
src/include/replication/basebackup_sink.h |   1 +
src/tools/msvc/Mkvcbuild.pm   |   1 +
17 files changed, 750 insertions(+), 26 deletions(-)



pgsql: Fix LZ4 tests for remaining buffer space.

2022-03-08 Thread Robert Haas
Fix LZ4 tests for remaining buffer space.

We should flush the buffer when the remaining space is less than
the maximum amount that we might need, not when it is less than or
equal to the maximum amount we might need.

Jeevan Ladhe, per an observation from me.

Discussion: 
http://postgr.es/m/canm22cgvma85o1akgs+dope8nsrt1zbz5_vyfs83_r+6nci...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1d4be6be65ab18aa3b240d9bc912ebece255c53b

Modified Files
--
src/backend/replication/basebackup_lz4.c | 4 ++--
src/bin/pg_basebackup/bbstreamer_lz4.c   | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)



pgsql: plpython: add missing plpython.h include to plpy_plpymodule.h

2022-03-08 Thread Andres Freund
plpython: add missing plpython.h include to plpy_plpymodule.h

The include was missing before 9b7e24a2cb3, but starting with that commit the
missing include causes cpluspluscheck to fail because the use of
PyMODINIT_FUNC isn't incidentally protected by an ifdef anymore.

Discussion: 
https://postgr.es/m/20220308045916.7baapelbgftoq...@alap3.anarazel.de

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/54c72eb5e5e63f99f68c054900424724b0570b20

Modified Files
--
src/pl/plpython/plpy_plpymodule.h | 1 +
1 file changed, 1 insertion(+)



pgsql: Stabilize test_decoding touching with sequences

2022-03-08 Thread Tomas Vondra
Stabilize test_decoding touching with sequences

Some of the test_decoding regression tests are unstable due to modifying
a sequence. The first increment of a sequence after a checkpoint is
always logged (and thus decoded), which makes the output unpredictable.
The runs are usually much shorter than a checkpoint internal, so these
failures are rare, but we've seen a couple of them on animals that are
either slow or are running with valgrind/clobber cache/...

Fixed by skipping sequence decoding in most tests, with the exception of
the test aimed at testing decoding of sequences.

Reported-by: Amita Kapila
Discussion: 
https://postgr.es/m/d045f3c2-6cfb-06d3-5540-e63c320df...@enterprisedb.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a180c2b34de0989269fdb819bff241a249bf5380

Modified Files
--
contrib/test_decoding/expected/ddl.out | 26 +++---
.../test_decoding/expected/decoding_in_xact.out|  2 +-
contrib/test_decoding/expected/replorigin.out  |  8 +++
contrib/test_decoding/expected/rewrite.out |  2 +-
contrib/test_decoding/expected/slot.out|  6 ++---
contrib/test_decoding/sql/ddl.sql  | 26 +++---
contrib/test_decoding/sql/decoding_in_xact.sql |  2 +-
contrib/test_decoding/sql/replorigin.sql   |  8 +++
contrib/test_decoding/sql/rewrite.sql  |  2 +-
contrib/test_decoding/sql/slot.sql |  6 ++---
10 files changed, 44 insertions(+), 44 deletions(-)



pgsql: plpython: Restore alternative output for plpython_error test.

2022-03-08 Thread Andres Freund
plpython: Restore alternative output for plpython_error test.

In db23464715f I removed the alternative output for plpython_error. Wrongly
so, because the output changed in Python 3.5, not Python 3.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/43e7787dd3387a7455fc4d9c353addb79a50ebe5

Modified Files
--
src/pl/plpython/expected/plpython_error.out   |   2 +-
src/pl/plpython/expected/plpython_error_5.out | 447 ++
2 files changed, 448 insertions(+), 1 deletion(-)



pgsql: doc: Improve references to term "FSM" in pageinspect and pgfrees

2022-03-08 Thread Michael Paquier
doc: Improve references to term "FSM" in pageinspect and pgfreespacemap

Author: Dong Wook Lee
Reviewed-by: Laurenz Albe
Discussion: 
https://postgr.es/m/CAAcBya+=F=HaHxJ7tGjAM1r=A=+bdbimpsex8vqrb4gjqfd...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7687ca996e558d95e68d2d0d70fed22a6317ba78

Modified Files
--
doc/src/sgml/pageinspect.sgml| 12 +++-
doc/src/sgml/pgfreespacemap.sgml | 17 +
doc/src/sgml/storage.sgml|  9 +
3 files changed, 21 insertions(+), 17 deletions(-)



pgsql: doc: Add ALTER/DROP ROUTINE to the event trigger matrix

2022-03-08 Thread Michael Paquier
doc: Add ALTER/DROP ROUTINE to the event trigger matrix

ALTER ROUTINE triggers the events ddl_command_start and ddl_command_end,
and DROP ROUTINE triggers sql_drop, ddl_command_start and
ddl_command_end, but this was not mention on the matrix table.

Reported-by: Leslie Lemaire
Discussion: 
https://postgr.es/m/164647533363.646.5802968483136493...@wrigleys.postgresql.org
Backpatch-through: 11

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/8f091572873c072ff844b0e2e18088ec51e4b03f

Modified Files
--
doc/src/sgml/event-trigger.sgml | 16 
1 file changed, 16 insertions(+)



pgsql: doc: Add ALTER/DROP ROUTINE to the event trigger matrix

2022-03-08 Thread Michael Paquier
doc: Add ALTER/DROP ROUTINE to the event trigger matrix

ALTER ROUTINE triggers the events ddl_command_start and ddl_command_end,
and DROP ROUTINE triggers sql_drop, ddl_command_start and
ddl_command_end, but this was not mention on the matrix table.

Reported-by: Leslie Lemaire
Discussion: 
https://postgr.es/m/164647533363.646.5802968483136493...@wrigleys.postgresql.org
Backpatch-through: 11

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/2cd7d8d53079cd74f0151465be316a94993d1218

Modified Files
--
doc/src/sgml/event-trigger.sgml | 16 
1 file changed, 16 insertions(+)



pgsql: doc: Add ALTER/DROP ROUTINE to the event trigger matrix

2022-03-08 Thread Michael Paquier
doc: Add ALTER/DROP ROUTINE to the event trigger matrix

ALTER ROUTINE triggers the events ddl_command_start and ddl_command_end,
and DROP ROUTINE triggers sql_drop, ddl_command_start and
ddl_command_end, but this was not mention on the matrix table.

Reported-by: Leslie Lemaire
Discussion: 
https://postgr.es/m/164647533363.646.5802968483136493...@wrigleys.postgresql.org
Backpatch-through: 11

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/ef00502a5a0a41ae2cab3dc9b06bd2278d29d5fd

Modified Files
--
doc/src/sgml/event-trigger.sgml | 16 
1 file changed, 16 insertions(+)



pgsql: doc: Add ALTER/DROP ROUTINE to the event trigger matrix

2022-03-08 Thread Michael Paquier
doc: Add ALTER/DROP ROUTINE to the event trigger matrix

ALTER ROUTINE triggers the events ddl_command_start and ddl_command_end,
and DROP ROUTINE triggers sql_drop, ddl_command_start and
ddl_command_end, but this was not mention on the matrix table.

Reported-by: Leslie Lemaire
Discussion: 
https://postgr.es/m/164647533363.646.5802968483136493...@wrigleys.postgresql.org
Backpatch-through: 11

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/789c83b27bbe618b87d60e40dbddae500eee4f26

Modified Files
--
doc/src/sgml/event-trigger.sgml | 16 
1 file changed, 16 insertions(+)



pgsql: doc: Add ALTER/DROP ROUTINE to the event trigger matrix

2022-03-08 Thread Michael Paquier
doc: Add ALTER/DROP ROUTINE to the event trigger matrix

ALTER ROUTINE triggers the events ddl_command_start and ddl_command_end,
and DROP ROUTINE triggers sql_drop, ddl_command_start and
ddl_command_end, but this was not mention on the matrix table.

Reported-by: Leslie Lemaire
Discussion: 
https://postgr.es/m/164647533363.646.5802968483136493...@wrigleys.postgresql.org
Backpatch-through: 11

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/e3df32bbc38bc4a20092ea18b482b81119fa72dd

Modified Files
--
doc/src/sgml/event-trigger.sgml | 16 
1 file changed, 16 insertions(+)