pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Technical Doubts <online.technicaldoubts@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Passing password in psql command
Date: Mon, 2 Mar 2015 10:42:58 +0100
Message-ID: <20150302094258.GB7715@depesz.com> (raw)
In-Reply-To: <CAJyuQsGLmNfmD3a=Y64-d6cVfpc6Ummc7i+oLic6weR8Nh7-1Q@mail.gmail.com>
References: <CAJyuQsGLmNfmD3a=Y64-d6cVfpc6Ummc7i+oLic6weR8Nh7-1Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On Mon, Mar 02, 2015 at 02:57:46PM +0530, Technical Doubts wrote:
> Dear Team,
> We are unable to connect to PostgreSQL db using psql by passing password
> parameter. If we don't give password, then on password promt it's accepting
> the password we type. But our scheduler script is having the psql line with
> password parameter. Helps highly appreciated. Thanks in advance.

There is no option to provide password in command line.

You either have to use environment variable, as described here:
http://www.postgresql.org/docs/current/interactive/libpq-envars.html
or pgpass file, as described here:
http://www.postgresql.org/docs/current/interactive/libpq-pgpass.html

Both of these places are listed in docs for psql
(http://www.postgresql.org/docs/current/interactive/app-psql.html) in
part "connecting to a database".

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <20150302094258.GB7715@depesz.com>
Permalink:  ../20150302094258.GB7715@depesz.com/
Also on:    postgresql.org/message-id/20150302094258.GB7715@depesz.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: depesz@depesz.com, online.technicaldoubts@gmail.com
  Subject: Re: Passing password in psql command
  In-Reply-To: <20150302094258.GB7715@depesz.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