pgsql: Add adjust_conf method to PostgresNode

2021-07-29 Thread Andrew Dunstan
Add adjust_conf method to PostgresNode This method will modify or delete an existing line in the config file rather than simply appending to the file. This makes adjustment of files for older versions much simpler and more compact. Branch -- master Details --- https://git.postgresql.org/

pgsql: Remove the last vestiges of Exporter from PostgresNode

2021-07-29 Thread Andrew Dunstan
Remove the last vestiges of Exporter from PostgresNode Clients wanting to call get_free_port now need to do so via a qualified name: PostgresNode::get_free_port(). Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5dc932f9e7b7d1992abd33d1c519899dd1c30272 Modified Fil

pgsql: Add -w back to the flags for pg_ctl (re)start in PostgresNode

2021-07-29 Thread Andrew Dunstan
Add -w back to the flags for pg_ctl (re)start in PostgresNode This is now the default for pg_ctl, but having the flag here explicitly does no harm and helps with backwards compatibility of the PostgresNode module. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b332

pgsql: Unify PostgresNode's new() and get_new_node() methods

2021-07-29 Thread Andrew Dunstan
Unify PostgresNode's new() and get_new_node() methods There is only one constructor now for PostgresNode, with the idiomatic name 'new'. The method is not exported by the class, and must be called as "PostgresNode->new('name',[args])". All the TAP tests that use PostgresNode are modified according

pgsql: Add a getter function for a PostgresNode install_path

2021-07-29 Thread Andrew Dunstan
Add a getter function for a PostgresNode install_path Experience has shown this can be useful, and while not strictly necessary we should not normally expose the internals of PostgresNode objects. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/87076c40834c2971f073f

pgsql: Add PostgresVersion.pm method to emit the major version string

2021-07-29 Thread Andrew Dunstan
Add PostgresVersion.pm method to emit the major version string For versions before 10, this will produce dotted notation unless a separator argument is given, in which case it is used. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1e8d89f8800e0aaafc66e87e8e5fedf5d

pgsql: Remove unused directory from test/ssl .gitignore

2021-07-29 Thread Daniel Gustafsson
Remove unused directory from test/ssl .gitignore The clientside log saved from the testrun was removed in 1caef31d9 but the entry in the .gitignore file remained. While this exists in older branches as well, it's mostly a cosmetical fix so no back- patching is done. Reviewed-by: Michael Paquier

pgsql: Refactor to make common functions in proto.c and worker.c.

2021-07-29 Thread Amit Kapila
Refactor to make common functions in proto.c and worker.c. This is a non-functional change only to refactor code to extract some replication logic into static functions. This is done as preparation for the 2PC streaming patch which also shares this common logic. Author: Peter Smith Reviewed-By:

pgsql: Avoid calling TestLib::perl2host on a symlinked directory

2021-07-29 Thread Andrew Dunstan
Avoid calling TestLib::perl2host on a symlinked directory Certain versions of msys2/Windows have been observed to resolve symlinks in perl2host rather than just follow them. This defeats using a symlinked shorter path to a longer path, and makes certain tests fail. We therefore call perl2host on t

pgsql: Make TestLib::perl2host more consistent and robust

2021-07-29 Thread Andrew Dunstan
Make TestLib::perl2host more consistent and robust Sometimes cygpath has been observed to return a path with a trailing slash. That can cause problems, Also, make "cygpath" usage consistent with "pwd -W" with respect to the use of forward slashes. Backpatch to release 14 where the current code wa

pgsql: Make TestLib::perl2host more consistent and robust

2021-07-29 Thread Andrew Dunstan
Make TestLib::perl2host more consistent and robust Sometimes cygpath has been observed to return a path with a trailing slash. That can cause problems, Also, make "cygpath" usage consistent with "pwd -W" with respect to the use of forward slashes. Backpatch to release 14 where the current code wa

pgsql: Avoid calling TestLib::perl2host on a symlinked directory

2021-07-29 Thread Andrew Dunstan
Avoid calling TestLib::perl2host on a symlinked directory Certain versions of msys2/Windows have been observed to resolve symlinks in perl2host rather than just follow them. This defeats using a symlinked shorter path to a longer path, and makes certain tests fail. We therefore call perl2host on t

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

2021-07-29 Thread Andrew Dunstan
On 7/27/21 2:24 PM, Andrew Dunstan wrote: > On 7/21/21 9:08 PM, Andrew Dunstan wrote: >> On 7/21/21 8:00 PM, Michael Paquier wrote: >>> On Wed, Jul 21, 2021 at 10:05:19AM -0400, Andrew Dunstan wrote: drongo, an MSVC animal running on the same machine, doesn't seem to have an issue, nor

pgsql: Improve libpq's handling of OOM during error message constructio

2021-07-29 Thread Tom Lane
Improve libpq's handling of OOM during error message construction. Commit ffa2e4670 changed libpq so that multiple error reports occurring during one operation (a connection attempt or query) are accumulated in conn->errorMessage, where before new ones usually replaced any prior error. At least i

pgsql: Improve libpq's handling of OOM during error message constructio

2021-07-29 Thread Tom Lane
Improve libpq's handling of OOM during error message construction. Commit ffa2e4670 changed libpq so that multiple error reports occurring during one operation (a connection attempt or query) are accumulated in conn->errorMessage, where before new ones usually replaced any prior error. At least i

pgsql: docs: Fix bit_count example output

2021-07-29 Thread Daniel Gustafsson
docs: Fix bit_count example output The returnvalue for the bit_count(::bytea) example was assuming a non-default value of standard_conforming_strings. This was fixed in the tests in commit ebedd0c78. Author: [email protected] Discussion: https://postgr.es/m/oszpr01mb6551ffac1088c82c3d79

pgsql: docs: Fix bit_count example output

2021-07-29 Thread Daniel Gustafsson
docs: Fix bit_count example output The returnvalue for the bit_count(::bytea) example was assuming a non-default value of standard_conforming_strings. This was fixed in the tests in commit ebedd0c78. Author: [email protected] Discussion: https://postgr.es/m/oszpr01mb6551ffac1088c82c3d79

pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code Buildfarm shows that this test has a further failure mode when a checkpoint starts earlier than expected, so we detect a "checkpoint completed" line that's not the one we want. Change the config to try and prevent this. Per buildfarm

pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code Buildfarm shows that this test has a further failure mode when a checkpoint starts earlier than expected, so we detect a "checkpoint completed" line that's not the one we want. Change the config to try and prevent this. Per buildfarm

Re: pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Tom Lane
Alvaro Herrera writes: > Close yet another race condition in replication slot test code Shouldn't that have gone into v13, too? regards, tom lane

Re: pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
On 2021-Jul-29, Tom Lane wrote: > Alvaro Herrera writes: > > Close yet another race condition in replication slot test code > > Shouldn't that have gone into v13, too? Oh, oops, yeah, I confused how recent this feature is. Will do in a minute. -- Álvaro Herrera 39°49'30"S 73°17'W

pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code Buildfarm shows that this test has a further failure mode when a checkpoint starts earlier than expected, so we detect a "checkpoint completed" line that's not the one we want. Change the config to try and prevent this. Per buildfarm

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

2021-07-29 Thread Michael Paquier
On Thu, Jul 29, 2021 at 01:26:22PM -0400, Andrew Dunstan wrote: > It gets stuck in a loop like this: > > ok 19 - one partial WAL segment was created > 0/2001968 > # Running: pg_receivewal -D > H:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_basebackup/tmp_check/t_020_pg_receivewal_primary_data/archiv

pgsql: Remove unused argument in apply_handle_commit_internal().

2021-07-29 Thread Amit Kapila
Remove unused argument in apply_handle_commit_internal(). Oversight in commit 0926e96c49. Author: Masahiko Sawada Reviewed-By: Amit Kapila Backpatch-through: 14, where it was introduced Discussion: https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xjfuvihn...@mail.gmail.com Branch ---

pgsql: Remove unused argument in apply_handle_commit_internal().

2021-07-29 Thread Amit Kapila
Remove unused argument in apply_handle_commit_internal(). Oversight in commit 0926e96c49. Author: Masahiko Sawada Reviewed-By: Amit Kapila Backpatch-through: 14, where it was introduced Discussion: https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xjfuvihn...@mail.gmail.com Branch ---