pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: rhpatrick@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15961: psql should be able to read password from stdin
Date: Mon, 19 Aug 2019 09:15:54 +0200
Message-ID: <3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com> (raw)
In-Reply-To: <15961-a17e673003b92f17@postgresql.org>
References: <15961-a17e673003b92f17@postgresql.org>

On 2019-08-16 16:20, PG Bug reporting form wrote:
> I understand why psql does not include a mechanism to pass the password on
> the command-line.  Having worked with and built other similar applications
> at Oracle, I tried to pipe the password into stdin of the psql command like
> so:  
> 
> echo P0stgr3s | psql --username=postgres
> 
> Unfortunately, psql ignores it and prompts me for the password.

The stdin for psql is already used for feeding SQL commands to execute
(e.g., psql < file.sql), so we can't also use it for getting a password.

It might be possible to create a new option to get the password from a
file descriptor (different from stdin), but that's not a feature that
exists today.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (6+ messages)  latest in thread

Message-ID: <3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com>
Permalink:  ../3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com/
Also on:    postgresql.org/message-id/3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, rhpatrick@gmail.com
  Subject: Re: BUG #15961: psql should be able to read password from stdin
  In-Reply-To: <3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com>
  References: <15961-a17e673003b92f17@postgresql.org> <3ea347a8-ffc6-cab7-1c32-a2311739a511@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox