Re: Automating logins for mundane chores - Mailing list pgsql-general

From Phoenix Kiula
Subject Re: Automating logins for mundane chores
Date
Msg-id e373d31e0708180402m75928c45g8079cdca6099ebfb@mail.gmail.com
Whole thread Raw
In response to Re: Automating logins for mundane chores  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Automating logins for mundane chores
Re: Automating logins for mundane chores
List pgsql-general
On 18/08/07, Magnus Hagander <magnus@hagander.net> wrote:
> Phoenix Kiula wrote:
> > I am writing some simple batch scripts to login to the DB and do a
> > pg_dump. Also, when I login to do my own SQL tinkering, I'd like not
> > to be asked for a password every time (which, for silly corporate
> > reasons, is quite a convoluted one).
> >
>
> It's in the environment on the client machine. If it's for your scripts,
> you can set it inside the script before you launch psql for example. If
> you need it.


Let's say my script was in Perl or PHP. What would the variable name
be to set this password? My script is unlikely to call psql, I'm
thinking of using only pg_dump and pg_restore.


> > 1. Where do I set up the automated password for (a) psql stuff and (b)
> > for bash scripts or cron jobs -- I suppose both could have the same
> > solution.
>
> a) In the home directory of the user running psql.
> b) In the home directory of the user running the cronjob.


Thanks for this. I am logged in as root. Put it there and it works. I
also put a ".psqlrc" in the home directory and that works too! Thanks!

I'd love to contribute back to the community and mention this in the
manual for 8.2/interactive. But the community login and commenting on
the site seems to be broken! Even after I am logged in, it does not
show it on each page of the site, and when I submit my comment (and
login all over again for it) it shows me a "numeric error". Where
should I post that error?

pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Automating logins for mundane chores
Next
From: Magnus Hagander
Date:
Subject: Re: Automating logins for mundane chores