pgsql: Re-enable TAP tests of pg_receivewal for ZLIB on Windows

2021-07-19 Thread Michael Paquier
Re-enable TAP tests of pg_receivewal for ZLIB on Windows This is a revert of 6cea447, that disabled those tests temporarily on Windows due to failures with bowerbird where gzflush() would fail when executed on a freshly-opened compressed and partial segment. This problem should be taken care of n

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix some issues with WAL segment opening for pg_receivewal --com

2021-07-19 Thread Michael Paquier
Fix some issues with WAL segment opening for pg_receivewal --compress The logic handling the opening of new WAL segments was fuzzy when using --compress if a partial, non-compressed, segment with the same base name existed in the repository storing those files. In this case, using --compress woul

pgsql: Fix potential buffer overruns in proto.c.

2021-07-19 Thread Amit Kapila
Fix potential buffer overruns in proto.c. Prevent potential buffer overruns when using strcpy to gid buffer. This has been introduced by commit a8fd13cab0. Reported-by: Tom Lane as per coverity Author: Peter Smith Reviewed-by: Amit Kapila Discussion: https://www.postgresql.org/message-id/161029.

pgsql: Doc: vacuum_multixact_failsafe_age is multixact-based.

2021-07-19 Thread Peter Geoghegan
Doc: vacuum_multixact_failsafe_age is multixact-based. Oversight in commit 1e55e7d1, which added a wraparound failsafe mechanism to VACUUM. Backpatch: 14-, where VACUUM failsafe was introduced. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dd498998a374b3d2a7f5211

pgsql: Doc: vacuum_multixact_failsafe_age is multixact-based.

2021-07-19 Thread Peter Geoghegan
Doc: vacuum_multixact_failsafe_age is multixact-based. Oversight in commit 1e55e7d1, which added a wraparound failsafe mechanism to VACUUM. Backpatch: 14-, where VACUUM failsafe was introduced. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e1cdf61726e8d709

pgsql: vacuumdb: Correct comment about --force-index-cleanup.

2021-07-19 Thread Peter Geoghegan
vacuumdb: Correct comment about --force-index-cleanup. Commit 3499df0d added a comment that incorrectly suggested that --force-index-cleanup did not appear in the same major version as the similar --no-index-cleanup option. In fact, both options are new to PostgreSQL 14. Backpatch: 14-, where bo

pgsql: vacuumdb: Correct comment about --force-index-cleanup.

2021-07-19 Thread Peter Geoghegan
vacuumdb: Correct comment about --force-index-cleanup. Commit 3499df0d added a comment that incorrectly suggested that --force-index-cleanup did not appear in the same major version as the similar --no-index-cleanup option. In fact, both options are new to PostgreSQL 14. Backpatch: 14-, where bo

pgsql: Don't use #if inside function-like macro arguments.

2021-07-19 Thread Thomas Munro
Don't use #if inside function-like macro arguments. No concrete problem reported, but in the past it's been known to cause problems on some compilers so let's avoid doing that. Reported-by: Tom Lane Discussion: https://postgr.es/m/234364.1626704007%40sss.pgh.pa.us Branch -- master Details

pgsql: Support direct I/O on macOS.

2021-07-19 Thread Thomas Munro
Support direct I/O on macOS. Macs don't understand O_DIRECT, but they can disable caching with a separate fcntl() call. Extend the file opening functions in fd.c to handle this for us if the caller passes in PG_O_DIRECT. For now, this affects only WAL data and even then only if you set: max_w

pgsql: Adjust commit 2dbe8905 for ancient macOS.

2021-07-19 Thread Thomas Munro
Adjust commit 2dbe8905 for ancient macOS. A couple of open flags used in an assertion didn't exist in macOS 10.4. Per build farm animal prairiedog. Also add O_EXCL while here (there are a few more standard flags but they're not relevant and likely to be missing). Branch -- master Details --

pgsql: Make new replication slot test code even less racy

2021-07-19 Thread Alvaro Herrera
Make new replication slot test code even less racy Further fix the test code in ead9e51e8236, this time by waiting until the checkpoint has completed before moving on; this ensures that the WAL segment removal has already happened when we create the next slot. Author: Kyotaro Horiguchi Discussio

pgsql: Make new replication slot test code even less racy

2021-07-19 Thread Alvaro Herrera
Make new replication slot test code even less racy Further fix the test code in ead9e51e8236, this time by waiting until the checkpoint has completed before moving on; this ensures that the WAL segment removal has already happened when we create the next slot. Author: Kyotaro Horiguchi Discussio

pgsql: Make new replication slot test code even less racy

2021-07-19 Thread Alvaro Herrera
Make new replication slot test code even less racy Further fix the test code in ead9e51e8236, this time by waiting until the checkpoint has completed before moving on; this ensures that the WAL segment removal has already happened when we create the next slot. Author: Kyotaro Horiguchi Discussio

pgsql: Remove some whitespace in generated C output

2021-07-19 Thread Peter Eisentraut
Remove some whitespace in generated C output It doesn't match the normal coding style. Reviewed-by: Kyotaro Horiguchi Reviewed-by: Heikki Linnakangas Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch -- master Details

pgsql: Make UCS_to_most.pl process encodings in sorted order

2021-07-19 Thread Peter Eisentraut
Make UCS_to_most.pl process encodings in sorted order This just makes the progress output easier to follow. Reviewed-by: Kyotaro Horiguchi Reviewed-by: Heikki Linnakangas Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch --