pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix check for PGHOST[ADDR] in pg_upgrade with Windows and tempor
Date: Tue, 01 Mar 2022 22:38:32 +0000
Message-ID: <E1nPB8Z-000UyJ-RR@gemulon.postgresql.org> (raw)

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@paquier.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(-)



Message-ID: <E1nPB8Z-000UyJ-RR@gemulon.postgresql.org>
Permalink:  ../E1nPB8Z-000UyJ-RR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nPB8Z-000UyJ-RR@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix check for PGHOST[ADDR] in pg_upgrade with Windows and tempor
  In-Reply-To: <E1nPB8Z-000UyJ-RR@gemulon.postgresql.org>
  References: <E1nPB8Z-000UyJ-RR@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox