pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Fix one-off bug causing missing commit timestamps for subtransac

2022-01-20 Thread Michael Paquier
Fix one-off bug causing missing commit timestamps for subtransactions The logic in charge of writing commit timestamps (enabled with track_commit_timestamp) for subtransactions had a one-bug bug, where it would be possible that commit timestamps go missing for the last subtransaction committed. W

pgsql: Add new simple TAP test for tablespaces, attempt II.

2022-01-20 Thread Thomas Munro
Add new simple TAP test for tablespaces, attempt II. See commit message for d1511fe1b040853f6e10d353e56b42bb96ae239d. This new version attempts to fix path translation problem on MSYS/Windows. Discussion: https://postgr.es/m/20220117055326.GD756210%40rfd.leadboat.com Branch -- master Detai

pgsql: Extend the options of pg_basebackup to control compression

2022-01-20 Thread Michael Paquier
Extend the options of pg_basebackup to control compression The option --compress is extended to accept a compression method and an optional compression level, as of the grammar METHOD[:LEVEL]. The methods currently support are "none" and "gzip", for client-side compression. Any of those methods

pgsql: Revert "Make configure prefer python3 to plain python."

2022-01-20 Thread Tom Lane
Revert "Make configure prefer python3 to plain python." This reverts commit f201da39edcd6ac1ab9a3edf3e20e2a73bbbe69e. The buildfarm is not ready for python3, evidently, so we'll give the owners some more time to get set up. Discussion: https://postgr.es/m/2872c9a0-4b0a-1354-d5f6-94d6f85ba...@ent

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Tom Lane
I wrote: > What I'm thinking of doing is inventing a "soft_stop" variant of > Cluster::stop that won't complain if pg_ctl stop fails, and then > having 017_shm's poll_start() call that before retrying the start > call. I did that, modeling the details on Cluster::start's fail_ok option. > It seem

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

pgsql: Tighten TAP tests' tracking of postmaster state some more.

2022-01-20 Thread Tom Lane
Tighten TAP tests' tracking of postmaster state some more. Commits 6c4a8903b et al. had a couple of deficiencies: * The logic I added to Cluster::start to see if a PID file is present could be fooled by a stale PID file left over from a previous postmaster. To fix, if we're not sure whether we e

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Tom Lane
Andres Freund writes: > IOW, the test doesn't actually quite seem to be working in the "local" case? > Hence not seeing the problem of picking up some wrong pid. It looks like there are two different failure cases: 1. The symptom shown by skink: # pg_ctl start failed; logfile: ... 2022-01-20 12

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Andres Freund
Hi, On 2022-01-20 09:32:16 -0500, Tom Lane wrote: > Seems like we need to do 'kill 0' on the PID we get from > the file to verify that there's really a postmaster there. > (I wonder how well that works on Windows? perlport claims > it does, but ...) We seem to successfully do that in pg_ctl's po

pgsql: Support base backup targets.

2022-01-20 Thread Robert Haas
Support base backup targets. pg_basebackup now has a --target=TARGET[:DETAIL] option. If specfied, it is sent to the server as the value of the TARGET option to the BASE_BACKUP command. If DETAIL is included, it is sent as the value of the new TARGET_DETAIL option to the BASE_BACKUP command. If t

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

pgsql: Allow clean.bat to be run from anywhere

2022-01-20 Thread Andrew Dunstan
Allow clean.bat to be run from anywhere This was omitted from c3879a7b4c which modified the other msvc .bat files. Per request from Juan José Santamaría Flecha Discussion: https://postgr.es/m/cac+axb0_fxygbqoayjca8um7ttbovp4l9axnvmhwk8wzat4...@mail.gmail.com Backpatch to all live branches. Br

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Tom Lane
I wrote: > Hmm. I think the problem is that poll_start() thinks it can just call > start() a second time after a failure. If it wasn't a true failure > but a timeout, then _pid is now set and the second call complains. Oh, wait --- the case that is failing is after 017_shm.pl has intentionally k

pgsql: Remove 'datlastsysoid'.

2022-01-20 Thread Robert Haas
Remove 'datlastsysoid'. It hasn't been used for anything for a long time. Up until recently, we still queried it when dumping very old servers, but since commit 30e7c175b81d53c0f60f6ad12d1913a6d7d77008, there's no longer any code at all that cares about it. Discussion: http://postgr.es/m/CA+Tgmo

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Tom Lane
Thomas Munro writes: > On Thu, Jan 20, 2022 at 10:29 AM Tom Lane wrote: >> TAP tests: check for postmaster.pid anyway when "pg_ctl start" fails. > This seems to have caused some kind of problem for the 017_shm.pl test: Hmm. I think the problem is that poll_start() thinks it can just call start

Re: pgsql: Test replay of regression tests, attempt II.

2022-01-20 Thread Thomas Munro
On Thu, Jan 20, 2022 at 6:24 PM Andres Freund wrote: > I wonder if the easiest way to make this test reliable would be to make the > table a temporary one? That now uses very aggressive horizons, there's no > bgwriter that could pin the page, etc. Good idea, thanks. I pushed that minimal change.

Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f

2022-01-20 Thread Thomas Munro
On Thu, Jan 20, 2022 at 10:29 AM Tom Lane wrote: > TAP tests: check for postmaster.pid anyway when "pg_ctl start" fails. > > "pg_ctl start" might start a new postmaster and then return failure > anyway, for example if PGCTLTIMEOUT is exceeded. If there is a > postmaster there, it's still incumben

pgsql: Try to stabilize reloptions test, again.

2022-01-20 Thread Thomas Munro
Try to stabilize reloptions test, again. Since the test requires reproducible behavior from VACUUM, and since DISABLE_PAGE_SKIPPING doesn't actually disable all forms of page skipping, let's use a temporary table to avoid contention. Back-patch to 12, like commit 3414099c. Discussion: https://p

pgsql: Try to stabilize reloptions test, again.

2022-01-20 Thread Thomas Munro
Try to stabilize reloptions test, again. Since the test requires reproducible behavior from VACUUM, and since DISABLE_PAGE_SKIPPING doesn't actually disable all forms of page skipping, let's use a temporary table to avoid contention. Back-patch to 12, like commit 3414099c. Discussion: https://p

pgsql: Try to stabilize reloptions test, again.

2022-01-20 Thread Thomas Munro
Try to stabilize reloptions test, again. Since the test requires reproducible behavior from VACUUM, and since DISABLE_PAGE_SKIPPING doesn't actually disable all forms of page skipping, let's use a temporary table to avoid contention. Back-patch to 12, like commit 3414099c. Discussion: https://p

pgsql: Try to stabilize reloptions test, again.

2022-01-20 Thread Thomas Munro
Try to stabilize reloptions test, again. Since the test requires reproducible behavior from VACUUM, and since DISABLE_PAGE_SKIPPING doesn't actually disable all forms of page skipping, let's use a temporary table to avoid contention. Back-patch to 12, like commit 3414099c. Discussion: https://p

pgsql: Call pg_newlocale_from_collation() also with default collation

2022-01-20 Thread Peter Eisentraut
Call pg_newlocale_from_collation() also with default collation Previously, callers of pg_newlocale_from_collation() did not call it if the collation was DEFAULT_COLLATION_OID and instead proceeded with a pg_locale_t of 0. Instead, now we call it anyway and have it return 0 if the default collatio