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 18:03:02
Message-ID: CANzqJaCOJALngyw3Sk7-H=L7vuWBqK3et7x78Ghe8JrPnL+LMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Dec 18, 2023 at 12:02 PM 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 11:09 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> 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.
>
> Hmph. I'm on (genuine) RHEL 8.9, and when I tried the command you
> showed it seemed to work fine. So there's some important detail
> you've not provided. Now I'm wondering about things like invisible
> characters and whether you managed to type something that looks like
> a "-" but is really some weird unicode character.
>
> Looking at the v14 pg_ctl code, I see it has an extra level of
> looping around getopt_long to try to cope with implementations
> that don't permute the arguments. So in theory it should work as
> documented everywhere. But I could see how things might get
> confused, if the subroutine misidentifies what is a switch.
>

There must be some PEBKAC involved that pg_ctl error handling didn't
explain well, because _this_ unreformatted command works. (I changed the
script, to make the startup options explicit.)

pg_ctl restart -wt999 -mfast \
-o "-c fsync=off" \
-o "-c full_page_writes=off" \
-o "-c log_statement=none" \
-o "-c log_temp_files=100kB" \
-o "-c maintenance_work_mem=2GB" \
-o "-c max_wal_size=36GB" \
-o "-c wal_level=minimal" \
-o "-c max_wal_senders=0" \
-o "-c wal_buffers=64MB" \
-o "-c log_checkpoints=off" \
-o "-c autovacuum=off"

$ pg_ctl status
pg_ctl: server is running (PID: 133557)
/usr/pgsql-14/bin/postgres "-c" "fsync=off" "-c" "full_page_writes=off"
"-c" "log_statement=none" "-c" "log_temp_files=100kB" "-c"
"maintenance_work_mem=2GB" "-c" "max_wal_size=36GB" "-c"
"wal_level=minimal" "-c" "max_wal_senders=0" "-c" "wal_buffers=64MB" "-c"
"log_checkpoints=off" "-c" "autovacuum=off"

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-12-18 19:28:05 Re: pg_ctl only allows 12 parameters?
Previous Message Tom Lane 2023-12-18 17:02:04 Re: pg_ctl only allows 12 parameters?