Re: psql invokation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Victor Yegorov" <viy(at)pirmabanka(dot)lv>
Cc: "Postgres Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: psql invokation
Date: 2003-03-21 15:10:49
Message-ID: 12650.1048259449@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Victor Yegorov" <viy(at)pirmabanka(dot)lv> writes:
> Is it possible to invoke psql from a script (executed via cron) and connect
> to remote server?

Sure.

> Actually, problem is that psql asks password and ignores any pipes I try.

In PG 7.3, the preferred way to deal with this is to keep passwords in
~/.pgpass. Note that this file cannot be found by psql unless HOME
is set in your environment --- which some crons don't set for you.
If the script works "by hand" and not from cron, suspect missing
environment values.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rao Kumar 2003-03-21 15:11:43 Postgre 7.3.2 pg_clog error
Previous Message Victor Yegorov 2003-03-21 14:01:45 psql invokation