Search Postgresql Archives

Re: How to get variable out to shell script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx http://www.gregsmith.com Baltimore, MD

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux