| From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Cc: | jeff(dot)laing(at)spatialnetworx(dot)ai |
| Subject: | BUG #19392: PG_UPGRADE is non-functional on Windows |
| Date: | 2026-02-04 02:29:19 |
| Message-ID: | 19392-d713ae74a25d81de@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 19392
Logged by: Jeff Laing
Email address: jeff(dot)laing(at)spatialnetworx(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2026-02-04 06:43:40 | Re: BUG #19392: PG_UPGRADE is non-functional on Windows |
| Previous Message | Álvaro Herrera | 2026-02-03 11:40:44 | Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem. |