pgsql: Fix check for PGHOST[ADDR] in pg_upgrade with Windows and tempor

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix check for PGHOST[ADDR] in pg_upgrade with Windows and tempor
Date: 2022-03-01 22:38:32
Message-ID: E1nPB8Z-000UyJ-RR@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix check for PGHOST[ADDR] in pg_upgrade with Windows and temporary paths

The checks currently done at the startup of pg_upgrade on PGHOST and
PGHOSTADDR to avoid any attempts to access to an external cluster fail
setting those parameters to Windows paths or even temporary paths
prefixed by an '@', as it only considers as a valid path strings
beginning with a slash.

As mentioned by Andres, is_unixsock_path() is designed to detect such
cases, so, like any other code paths dealing with the same problem (psql
and libpq), use it rather than assuming that all valid paths are
prefixed with just a slash.

This issue has been found while testing the TAP tests of pg_upgrade
through the CI on Windows. This is a bug, but nobody has complained
about it since pg_upgrade exists so no backpatch is done, at least for
now.

Analyzed-by: Andres Freund, Michael Paquier
Discussion: https://postgr.es/m/YeYj4DU5qY/rtKXT(at)paquier(dot)xyz

Branch
------
master

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

Modified Files
--------------
src/bin/pg_upgrade/server.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2022-03-01 23:33:26 pgsql: Fix typo in pgbench messages.
Previous Message Peter Eisentraut 2022-03-01 10:33:45 pgsql: psql: Additional tests