Re: pg_ctl only allows 12 parameters?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_ctl only allows 12 parameters?
Date: 2023-12-18 16:31:55
Message-ID: CANzqJaC=pY4fOLkNjVsGxm4w2C=h=KR7ndLRY4f9aEEKKuQiNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Dec 18, 2023 at 11:09 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Ron Johnson <ronljohnsonjr(at)gmail(dot)com> writes:
> > On Mon, Dec 18, 2023 at 10:41 AM David G. Johnston <
> > david(dot)g(dot)johnston(at)gmail(dot)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?
>

$ psql -V
psql (PostgreSQL) 14.10
$ postgres -V
postgres (PostgreSQL) 14.10
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 (Ootpa)
# This is a "SLES Expanded Support platform 8.9"
# The above "Red Hat Enterprise Linux Server" string is only used to
# keep software compatibility.

$ yum list installed 'postgresql*'
Installed Packages
postgresql14.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-contrib.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-docs.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-libs.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-plperl.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-plpython3.x86_64 14.10-1PGDG.rhel8 @@commandline
postgresql14-server.x86_64 14.10-1PGDG.rhel8 @@commandline

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Aditya D 2023-12-18 16:47:38 Guidance required to summarize the migration breaking changes between PG versions
Previous Message Tom Lane 2023-12-18 16:09:23 Re: pg_ctl only allows 12 parameters?