pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: hardcode password in connect string
Date: Fri, 13 Apr 2018 12:47:55 -0600
Message-ID: <fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.com> (raw)
In-Reply-To: <CC538BE6-170C-46C8-B79D-93BADDA8E3CB@jimkeener.com>
References: <CAMBRECAUBdTe6fFWynyj6NE2yURNg+sLsra2RL4gh2j5FwZ0Og@mail.gmail.com>
	<CC538BE6-170C-46C8-B79D-93BADDA8E3CB@jimkeener.com>

On 04/13/2018 12:46 PM, James Keener wrote:
> Is setting it as an environment variable an option? 
> https://www.postgresql.org/docs/9.1/static/libpq-envars.html
>
> Alternatively, a service file? 
> https://www.postgresql.org/docs/9.0/static/libpq-pgservice.html
>
> Jim
>
> On April 13, 2018 2:43:01 PM EDT, David Gauthier 
> <davegauthierpg@gmail.com> wrote:
>
>     Hi:
>
>     PG v9.5.2 on RHEL
>
>     I like to use an alias to connect to my favorite DBs but don't
>     like to enter passwords.  I used to just disable passwords
>     (working behind a firewall), but this one is different.  I see
>     nothing in the interactive connect string where I can enter the
>     password...
>
>     psql -h thehost -U memyselfi mydb
>
>     Missing something like "-p mypassword"
>
>     Is there a way I can stick the pw in the linux alias definition ?
>
>     Just thinking something like this may be available since hardcoded
>     passwords are supported in perl/dbi, pg driver
>
>     Thanks !
>
>
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity. 
This is usually done in ~/.pgpass

view thread (8+ messages)  latest in thread

Message-ID: <fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.com>
Permalink:  ../fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.com/
Also on:    postgresql.org/message-id/fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.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-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: hardcode password in connect string
  In-Reply-To: <fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.com>
  References: <CAMBRECAUBdTe6fFWynyj6NE2yURNg+sLsra2RL4gh2j5FwZ0Og@mail.gmail.com> <CC538BE6-170C-46C8-B79D-93BADDA8E3CB@jimkeener.com> <fa8b5af2-dda3-bed9-1514-a259d397a9d9@gmail.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