agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_ctl: Error out on Windows-only options on other platforms
Date: Fri, 11 Sep 2026 16:00:43 +0000
Message-ID: <E1x53gA-00000004SGW-12So@gemulon.postgresql.org> (raw)

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@proxel.se>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.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(-)



Message-ID: <E1x53gA-00000004SGW-12So@gemulon.postgresql.org>
Permalink:  ../E1x53gA-00000004SGW-12So@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x53gA-00000004SGW-12So@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_ctl: Error out on Windows-only options on other platforms
  In-Reply-To: <E1x53gA-00000004SGW-12So@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox