Subject: Re: BUG #19392: PG_UPGRADE is non-functional on Windows

From: "David G. Johnston" <[email-masked]>
Date: Tue, 3 Feb 2026 23:43:40 -0700

On Tuesday, February 3, 2026, PG Bug reporting form <[email-masked]>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      19392
> Logged by:          Jeff Laing
> Email address:      [email-masked]
> 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.

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 4 Feb 2026 07:32:34 -0500

On 2026-02-04 We 1:43 AM, David G. Johnston wrote:
> On Tuesday, February 3, 2026, PG Bug reporting form 
> <[email-masked]> wrote:
>
> 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

---

From: Jeff Laing <[email-masked]>
Date: Wed, 4 Feb 2026 21:53:46 +0000

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 <[email-masked]>
Sent: Wednesday, 4 February 2026 11:33 PM
To: David G. Johnston <[email-masked]>; Jeff Laing <[email-masked]>; [email-masked]
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 <[email-masked]<mailto:[email-masked]>> wrote:
The following bug has been logged on the website:

Bug reference:      19392
Logged by:          Jeff Laing
Email address:      [email-masked]<mailto:[email-masked]>
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/>

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 4 Feb 2026 16:38:46 -0700

On Wed, Feb 4, 2026, 13:53 Jeff Laing <[email-masked]> 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.

---

From: Jeff Laing <[email-masked]>
Date: Thu, 5 Feb 2026 02:57:13 +0000

>> From: David G. Johnston [email-masked]<mailto:[email-masked]>
>> Sent: Thursday, 5 February 2026 10:39 AM
>>

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.

---

From: Tom Lane <[email-masked]>
Date: Wed, 04 Feb 2026 23:23:25 -0500

> 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