pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_ctl only allows 12 parameters?
Date: Mon, 18 Dec 2023 11:09:23 -0500
Message-ID: <3960907.1702915763@sss.pgh.pa.us> (raw)
In-Reply-To: <CANzqJaCSpziN3onfthDgy02hGWF_mvLLcZCzNttw2_jmbp4++A@mail.gmail.com>
References: <CANzqJaDCagH5wNkPQ42=Fx3mJPR-YnB3PWFdCAYAVdb9=Q+t-A@mail.gmail.com>
	<CAKFQuwbBvswquRFOZBeXSa5qvwBwmWvzNedPTP3JOBvzBo48TA@mail.gmail.com>
	<CANzqJaAL5OpkujQzDSgN5HWamWeOVcaL39cAgW_JoW+YKu5Ziw@mail.gmail.com>
	<CAKFQuwb=Qo49SpcA6obmA2xtjV3Nc8mxPkhsyoxKFJbTWA_ngg@mail.gmail.com>
	<CANzqJaCSpziN3onfthDgy02hGWF_mvLLcZCzNttw2_jmbp4++A@mail.gmail.com>

Ron Johnson <ronljohnsonjr@gmail.com> writes:
> On Mon, Dec 18, 2023 at 10:41 AM David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>> I'm thinking that the forced ordering being different than what is
>> documented is a shell-specific issue.  As for why only one of restart,
>> stop, start, etc... can be specified for any given invocation of pg_ctl,
>> that seems like an entirely realistic limitation and typo-preventing
>> feature.

> The error message is "pg_ctl: *too many command-line arguments*".  It's
> manifestly obvious that the command failed when I added a "-" option, not a
> "start", "stop" command. and yet pg_ctl complained about command-line
> arguments.

The program's coding expects that optional switches will appear before
the action specifier.  You can get away with writing the action first
only if the version of getopt_long() that's in use will permute the
argument array to move non-options to the end.  That's always true on
glibc-based platforms, but otherwise usually not, at least in PG v14.

(Yes, I'm aware that pg_ctl's --help message claims this works
everywhere.  It's lying.)

Having said that, the most obvious way to explain the results you
seem to be getting is that you're using a version of getopt_long()
that tries to permute the arguments and is getting it wrong.
So, what's the platform?  And are you quite sure your psql is v14?

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <3960907.1702915763@sss.pgh.pa.us>
Permalink:  ../3960907.1702915763@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3960907.1702915763@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com, david.g.johnston@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: pg_ctl only allows 12 parameters?
  In-Reply-To: <3960907.1702915763@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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