Skip site navigation (1) Skip section navigation (2)

Re: psql: default base and password reading

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Cc: Bradley McLean <brad(at)bradm(dot)net>, Adam Osuchowski <adwol(at)polsl(dot)gliwice(dot)pl>
Subject: Re: psql: default base and password reading
Date: 2001-10-13 04:21:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
> > The password reading patch may be useful, but I suggest that you
> > reverse the meaning of the option, so that you do not change the
> > current behavior.  This would be a normal practice for backward
> > compatibility.
> I like the /dev/tty fix.  I assumed we always read passwords from
> /dev/tty and not stdin.  I know of no other software that even allows
> passwords from stdin.  You usually have to use 'expect' for that very
> purpose.  I would not even supply an option to read it from stdin.

Attached is an updated version of the patch.  It does not have the
'template1' default because many people prefer our current behavior.

The patch uses /dev/tty if it can open it, and stdin if it can't.  It
does not have a psql flag to force stdin because there is little reason
to read a password from stdin in any reasonable usage.

In fact, I wonder if we should just fail if we need to prompt for a
password and can't open /dev/tty.  The function is simple_prompt() and
if we can't open /dev/tty, maybe we should just assume the user typed


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

In response to


pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-10-13 04:24:00
Subject: Re: [PATCH] unconditionally enable pltcl-unknown
Previous:From: Paul A VixieDate: 2001-10-13 04:05:29
Subject: Re: IPv6 Support for INET/CIDR types.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group