Thread: pg_ctl -w option does not behave as documented

pg_ctl -w option does not behave as documented

From
"Daniel Alvarez"
Date:
PostgreSQL 7.2.1 / SUSE Linux 8.0

According to the output of "pg_ctl --help", the -w option (lowercase)
should force the frontend to wait until the postmaster's startup completes.
Instead it prompts for a password, as with the (-W) option (uppercase).
Ommiting the option, the frontend still blocks until the end of startup.

The behavior described is trivial and I won't bother you with unnecessary d=
etails.
For reproduction, invoke

   pg_ctl start -w -l somelog -o "-i" -D somecluster

and you'll be prompted for a password.

This was correctly implemented in version 7.1.3 and may require a
change in the invocing scripts when upgrading to version 7.2.1.

Re: pg_ctl -w option does not behave as documented

From
Bruce Momjian
Date:
Uh, do you have a password configured for the super-user?  Could that be
the prompt?

---------------------------------------------------------------------------

Daniel Alvarez wrote:
> PostgreSQL 7.2.1 / SUSE Linux 8.0
>
> According to the output of "pg_ctl --help", the -w option (lowercase)
> should force the frontend to wait until the postmaster's startup completes.
> Instead it prompts for a password, as with the (-W) option (uppercase).
> Ommiting the option, the frontend still blocks until the end of startup.
>
> The behavior described is trivial and I won't bother you with unnecessary details.
> For reproduction, invoke
>
>    pg_ctl start -w -l somelog -o "-i" -D somecluster
>
> and you'll be prompted for a password.
>
> This was correctly implemented in version 7.1.3 and may require a
> change in the invocing scripts when upgrading to version 7.2.1.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: pg_ctl -w option does not behave as documented

From
Bruce Momjian
Date:
The pg_ctl code has this warning:

    # FIXME:  This is horribly misconceived.
    # 1) If password authentication is set up, the connection will fail.
    # 2) If a virtual host is set up, the connection may fail.
    # 3) If network traffic filters are set up tight enough, the connection
    #    may fail.
    # 4) When no Unix domain sockets are available, the connection will
    #    fail.  (Using TCP/IP by default ain't better.)
    # 5) When a different port is configured, the connection will fail
    #    or go to the wrong server.
    # 6) If the dynamic loader is not set up correctly (for this user/at
    #    this time), psql will fail (to find libpq).
    # 7) If psql is misconfigured, this may fail.
                if "$PGPATH/psql" -l >/dev/null 2>&1

Feel free to send over a patch.  ;-)


---------------------------------------------------------------------------

Daniel Alvarez wrote:
> PostgreSQL 7.2.1 / SUSE Linux 8.0
>
> According to the output of "pg_ctl --help", the -w option (lowercase)
> should force the frontend to wait until the postmaster's startup completes.
> Instead it prompts for a password, as with the (-W) option (uppercase).
> Ommiting the option, the frontend still blocks until the end of startup.
>
> The behavior described is trivial and I won't bother you with unnecessary details.
> For reproduction, invoke
>
>    pg_ctl start -w -l somelog -o "-i" -D somecluster
>
> and you'll be prompted for a password.
>
> This was correctly implemented in version 7.1.3 and may require a
> change in the invocing scripts when upgrading to version 7.2.1.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026