pg_ctl -w option does not behave as documented

Started by Daniel Alvarezalmost 24 years ago3 messagesbugs
Jump to latest
#1Daniel Alvarez
alvarez@st-oneline.net

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.

#2Bruce Momjian
bruce@momjian.us
In reply to: Daniel Alvarez (#1)
Re: pg_ctl -w option does not behave as documented

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
#3Bruce Momjian
bruce@momjian.us
In reply to: Daniel Alvarez (#1)
Re: pg_ctl -w option does not behave as documented

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