pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #19392: PG_UPGRADE is non-functional on Windows
8+ messages / 6 participants
[nested] [flat]
* BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 02:29 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 2 replies; 8+ messages in thread
From: PG Bug reporting form @ 2026-02-04 02:29 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: jeff.laing@spatialnetworx.ai
The following bug has been logged on the website:
Bug reference: 19392
Logged by: Jeff Laing
Email address: jeff.laing@spatialnetworx.ai
PostgreSQL version: 18.1
Operating system: Windows 11
Description:
After struggling with it for a while, I’ve come to the conclusion that
PG_UPGRADE is not functional on Windows.
Although there may be a permissions error still present, I can see that the
command-line construction is obviously in error.
The offending source code is in src\bin\pg_upgrade\server.c – in the 18
sources, it looks like this:
/*
* Use -b to disable autovacuum and logical replication launcher
* (effective in PG17 or later for the latter).
*/
snprintf(cmd, sizeof(cmd),
"\"%s/pg_ctl\" -w -l \"%s/%s\" -D \"%s\" -o \"-p %d
-b%s %s%s\" start",
cluster->bindir,
log_opts.logdir,
SERVER_LOG_FILE, cluster->pgconfig, cluster->port,
pgoptions.data,
cluster->pgopts ? cluster->pgopts : "",
socket_string);
This results in command-lines that look like:
"C:/postgresql16/bin/pg_ctl" -w -l
"C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_upgrade_server.log"
-D "C:/postgresql16/data" -o "-p 5432 -b " start >>
"C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_upgrade_server_start.log"
2>&1
connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no
password supplied
could not connect to source postmaster started with the command:
"C:/postgresql16/bin/pg_ctl" -w -l
"C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_upgrade_server.log"
-D "C:/postgresql16/data" -o "-p 5432 -b " start
Failure, exiting
Note the quoting around the -o, -p and -b arguments.
There should perhaps be TWO double-quotes after -o or it should not be
present.
There should not be a double-quote after -b
The problem appears as far back as the 16 sources.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 06:43 David G. Johnston <david.g.johnston@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
1 sibling, 1 reply; 8+ messages in thread
From: David G. Johnston @ 2026-02-04 06:43 UTC (permalink / raw)
To: jeff.laing@spatialnetworx.ai <jeff.laing@spatialnetworx.ai>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Tuesday, February 3, 2026, PG Bug reporting form <noreply@postgresql.org>
wrote:
> The following bug has been logged on the website:
>
> Bug reference: 19392
> Logged by: Jeff Laing
> Email address: jeff.laing@spatialnetworx.ai
> PostgreSQL version: 18.1
> Operating system: Windows 11
> Description:
>
> After struggling with it for a while, I’ve come to the conclusion that
> PG_UPGRADE is not functional on Windows.
This is a very hard to accept premise and this bug report doesn’t support
it.
>
> This results in command-lines that look like:
>
> "C:/postgresql16/bin/pg_ctl" -w -l
> "C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_
> upgrade_server.log"
> -D "C:/postgresql16/data" -o "-p 5432 -b " start >>
> "C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_
> upgrade_server_start.log"
> 2>&1
>
> connection to server at "localhost" (::1), port 5432 failed: fe_sendauth:
> no
> password supplied
> could not connect to source postmaster started with the command:
> "C:/postgresql16/bin/pg_ctl" -w -l
> "C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_
> upgrade_server.log"
> -D "C:/postgresql16/data" -o "-p 5432 -b " start
> Failure, exiting
>
> Note the quoting around the -o, -p and -b arguments.
> There should perhaps be TWO double-quotes after -o or it should not be
> present.
> There should not be a double-quote after -b
Showing the log files generated by the startup attempts would be helpful.
Your guess here regarding how the “-o” argument’s value behaves is
incorrect, the quotes are precisely where the documentation says they
should be. They should result in something like: “…/postgres -p 5432 -b”
as a subprocess of the pg_ctl command which is valid.
> The problem appears as far back as the 16 sources.
>
>
It seems even more unlikely that if this were the underlying cause it would
have gone undetected for two full releases.
We will need a reproducing bug report with the commands issued and logs
generated.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 06:50 Michael Paquier <michael@paquier.xyz>
parent: PG Bug reporting form <noreply@postgresql.org>
1 sibling, 0 replies; 8+ messages in thread
From: Michael Paquier @ 2026-02-04 06:50 UTC (permalink / raw)
To: jeff.laing@spatialnetworx.ai; pgsql-bugs@lists.postgresql.org
On Wed, Feb 04, 2026 at 02:29:19AM +0000, PG Bug reporting form wrote:
> connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no
> password supplied
> could not connect to source postmaster started with the command:
> "C:/postgresql16/bin/pg_ctl" -w -l
> "C:/postgresql18/data/pg_upgrade_output.d/20260204T130353.043/log/pg_upgrade_server.log"
> -D "C:/postgresql16/data" -o "-p 5432 -b " start
> Failure, exiting
>
> Note the quoting around the -o, -p and -b arguments.
> There should perhaps be TWO double-quotes after -o or it should not be
> present.
> There should not be a double-quote after -b
Why? pg_ctl -o is defined as an option to which is given a
string. This string includes a set of options to pass down to the
"initdb" or "postgres" commands kicked by pg_ctl when interacting with
a. In this case, "-p 5432 -b " looks like a valid option value to
me. This means to start a server with port 5432, disabling
autovacuum, something that pg_upgrade requires.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../aYLsIfI-yf56z0b8@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 12:32 Andrew Dunstan <andrew@dunslane.net>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2026-02-04 12:32 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; jeff.laing@spatialnetworx.ai <jeff.laing@spatialnetworx.ai>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On 2026-02-04 We 1:43 AM, David G. Johnston wrote:
> On Tuesday, February 3, 2026, PG Bug reporting form
> <noreply@postgresql.org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference: 19392
> Logged by: Jeff Laing
> Email address: jeff.laing@spatialnetworx.ai
> PostgreSQL version: 18.1
> Operating system: Windows 11
> Description:
>
> After struggling with it for a while, I’ve come to the conclusion that
> PG_UPGRADE is not functional on Windows.
>
>
> This is a very hard to accept premise and this bug report doesn’t
> support it.
>
>
pg_upgrade is tested on Windows all the time, both in the buildfarm and
in CI, so the statement that it is not functional doesn't add up.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* RE: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 21:53 Jeff Laing <jeff.laing@spatialnetworx.ai>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Laing @ 2026-02-04 21:53 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; Andrew Dunstan <andrew@dunslane.net>
Mea culpa, I apologise to the list for misreading the source code.
My problem stemmed from pg_upgrade needing to have the superuser password available via PGPASS (or PGPASSWORD). It's not clear why it included the word "postmaster" in the error message which sent me off down a rathole of "it has no idea what it's doing, perhaps its connecting to the wrong instance, etc..."
>>> port 5432 failed: fe_sendauth: no password supplied could not connect to source postmaster started with the command
I do think that having it check for not having a password and actually announcing that up front would be an improvement, rather than doing the compatibility checks, etc and waiting until it tries to startup before failing cryptically.
Nevertheless, I have successfully upgraded my V16 to V18 using pg_upgrade on Windows 11.
I can't see how I close the ticket, but it can certainly be closed as PEBKAC
Jeff
From: Andrew Dunstan <andrew@dunslane.net>
Sent: Wednesday, 4 February 2026 11:33 PM
To: David G. Johnston <david.g.johnston@gmail.com>; Jeff Laing <jeff.laing@spatialnetworx.ai>; pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19392: PG_UPGRADE is non-functional on Windows
On 2026-02-04 We 1:43 AM, David G. Johnston wrote:
On Tuesday, February 3, 2026, PG Bug reporting form <noreply@postgresql.org<mailto:noreply@postgresql.org>> wrote:
The following bug has been logged on the website:
Bug reference: 19392
Logged by: Jeff Laing
Email address: jeff.laing@spatialnetworx.ai<mailto:jeff.laing@spatialnetworx.ai>
PostgreSQL version: 18.1
Operating system: Windows 11
Description:
After struggling with it for a while, I've come to the conclusion that
PG_UPGRADE is not functional on Windows.
This is a very hard to accept premise and this bug report doesn't support it.
pg_upgrade is tested on Windows all the time, both in the buildfarm and in CI, so the statement that it is not functional doesn't add up.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com<https://www.enterprisedb.com/;
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-04 23:38 David G. Johnston <david.g.johnston@gmail.com>
parent: Jeff Laing <jeff.laing@spatialnetworx.ai>
0 siblings, 1 reply; 8+ messages in thread
From: David G. Johnston @ 2026-02-04 23:38 UTC (permalink / raw)
To: Jeff Laing <jeff.laing@spatialnetworx.ai>; +Cc: PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>; Andrew Dunstan <andrew@dunslane.net>
On Wed, Feb 4, 2026, 13:53 Jeff Laing <jeff.laing@spatialnetworx.ai> wrote:
> . It’s not clear why it included the word “postmaster” in the error
> message which sent me off down a rathole of “it has no idea what it’s
> doing, perhaps its connecting to the wrong instance, etc…”
>
>
>
Postmaster is the name of the executable that is the server program.
We also don't have a formal bug tracker, so nothing exists to close.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
* RE: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-05 02:57 Jeff Laing <jeff.laing@spatialnetworx.ai>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Laing @ 2026-02-05 02:57 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
>> From: David G. Johnston david.g.johnston@gmail.com<mailto:david.g.johnston@gmail.com>
>> Sent: Thursday, 5 February 2026 10:39 AM
>>
>> Postmaster is the name of the executable that is the server program.
Perhaps on Unix, but I don’t think it is on Windows?
C:> netstat -abo
…
TCP 0.0.0.0:5432 SPNX-1Z2SRV3:0 LISTENING 39060
[postgres.exe]
…
I can see that the “directory structure” has mentions of “postmaster”
[13:50:24.50 C:\postgresql18]
C:> dir/s/b postmaster*
C:\postgresql18\data\postmaster.opts
C:\postgresql18\data\postmaster.pid
C:\postgresql18\include\server\postmaster
C:\postgresql18\include\server\postmaster\postmaster.h
… but on windows, that’s not visible in the pathname of the executable.
[13:52:20.45 C:\postgresql18]
C:> dir/s/b postgres.exe
C:\postgresql18\bin\postgres.exe
Again, only an issue because in a past life, “postmaster” was a different user-id used by a completely different application, so it’s not critical, it’s just misled and sent me down the wrong blind alley.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #19392: PG_UPGRADE is non-functional on Windows
@ 2026-02-05 04:23 Tom Lane <tgl@sss.pgh.pa.us>
parent: Jeff Laing <jeff.laing@spatialnetworx.ai>
0 siblings, 0 replies; 8+ messages in thread
From: Tom Lane @ 2026-02-05 04:23 UTC (permalink / raw)
To: Jeff Laing <jeff.laing@spatialnetworx.ai>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Jeff Laing <jeff.laing@spatialnetworx.ai> writes:
> From: David G. Johnston david.g.johnston@gmail.com<mailto:david.g.johnston@gmail.com>
>> Postmaster is the name of the executable that is the server program.
> Perhaps on Unix, but I don’t think it is on Windows?
There hasn't been a "postmaster" executable on Unix either for a few
years now. But we still use that terminology for the server's topmost
process. See
https://www.postgresql.org/docs/current/connect-estab.html
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2026-02-05 04:23 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-04 02:29 BUG #19392: PG_UPGRADE is non-functional on Windows PG Bug reporting form <noreply@postgresql.org>
2026-02-04 06:43 ` David G. Johnston <david.g.johnston@gmail.com>
2026-02-04 12:32 ` Andrew Dunstan <andrew@dunslane.net>
2026-02-04 21:53 ` Jeff Laing <jeff.laing@spatialnetworx.ai>
2026-02-04 23:38 ` David G. Johnston <david.g.johnston@gmail.com>
2026-02-05 02:57 ` Jeff Laing <jeff.laing@spatialnetworx.ai>
2026-02-05 04:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-02-04 06:50 ` Michael Paquier <michael@paquier.xyz>
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