Bug #690: pg_ctl doesn't act properly for option -w

Started by PostgreSQL Bugs Listalmost 24 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

shangwu (swqi@strongholdtech.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_ctl doesn't act properly for option -w

Long Description
If you start postmaster at some port number other than 5432 by pg_ctl with option -w, it doesn't block any more.
The problem is that pg_ctl calls "psql -l" to check if the postmaster is started. Running psql without correct port number gets immediately failed with error exit code.

Sample Code

No file was uploaded with this report

#2Bruce Momjian
bruce@momjian.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #690: pg_ctl doesn't act properly for option -w

pgsql-bugs@postgresql.org wrote:

shangwu (swqi@strongholdtech.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_ctl doesn't act properly for option -w

Long Description
If you start postmaster at some port number other than 5432 by pg_ctl with option -w, it doesn't block any more.
The problem is that pg_ctl calls "psql -l" to check if the postmaster is started. Running psql without correct port number gets immediately failed with error exit code.

Alas, inside pg_ctl, there is this comment:

# 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.

Feel free to send in a patch. :-)

-- 
  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