pgsql: pg_ctl: Error out on Windows-only options on other platforms

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_ctl: Error out on Windows-only options on other platforms
Date: 2026-09-11 16:00:43
Message-ID: E1x53gA-00000004SGW-12So@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_ctl: Error out on Windows-only options on other platforms

Several pg_ctl command-line options are used only on Windows, but
pg_ctl accepted them anyway on all platforms but didn't do anything
with them.

This commit changes it to report an error if an option is specified
but the platform doesn't make use of it. The affected options are -e,
-N, -P, -U. The option -S already errored out on non-Windows
platforms; the new behavior of the other options is aligned with that.

The --help output already didn't list these options on non-Windows
builds, so the fact that they were accepted silently was already
inconsistent. The man page already lists them as "Options for
Windows".

Several global variables that were set but then only read on Windows,
are now in #ifdef WIN32 blocks. This avoids -Wunused-but-set-global
warnings that the new clang 23 enables via -Wall.

Reviewed-by: Andreas Karlsson <andreas(at)proxel(dot)se>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://www.postgresql.org/message-id/flat/eb013f9d-2247-444e-8815-9d17b4ce78e7%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6a1c1102c4a36c4b80bba4a46f1ad8c125f8dd4e

Modified Files
--------------
src/bin/pg_ctl/pg_ctl.c | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-09-11 17:21:56 pgsql: Fix heap_update() ignoring TABLE_UPDATE_NO_LOGICAL for TOAST tup
Previous Message Tom Lane 2026-09-11 15:51:18 pgsql: Doc: update v19 release notes for reversion of a9c350d9e.