Re: How to get variable out to shell script - Mailing list pgsql-general

From Greg Smith
Subject Re: How to get variable out to shell script
Date
Msg-id alpine.GSO.2.01.0909231637210.26451@westnet.com
Whole thread Raw
In response to Re: How to get variable out to shell script  (Abel Camarillo <acamari@the00z.org>)
List pgsql-general
On Sun, 20 Sep 2009, Abel Camarillo wrote:

> #!/bin/sh
> dbname=
> user=
> password=

In general it's better to use the .pgpass/PGPASSFILE mechanism:

http://www.postgresql.org/docs/current/static/libpq-pgpass.html

to cache passwords like this, if you can't eliminate the need for them
altogether through pg_hba.conf adjustments.  That way, when you do change
the database user's password, there's only one place to update for all of
your scripts that talk to the database as that user.  It's better still to
parameterize all of these connection things into a global configuration
file, but now you're talking an extra bit of coding; pgpass support you
basically get for free in your app if it's talking to the database with
psql.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

pgsql-general by date:

Previous
From: Shane Spencer
Date:
Subject: Re: More straight forward method to convert seconds::bigint to interval
Next
From: Jaromír Talíř
Date:
Subject: lazy vacuum and AccessExclusiveLock