pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Victor Yegorov <viy@pirmabanka.lv>
Cc: Postgres Admin <pgsql-admin@postgresql.org>
Subject: Re: psql invokation
Date: Fri, 21 Mar 2003 10:10:49 -0500
Message-ID: <12650.1048259449@sss.pgh.pa.us> (raw)
In-Reply-To: <20030321140145.GE20481@pirmabanka.lv>
References: <20030321140145.GE20481@pirmabanka.lv>

"Victor Yegorov" <viy@pirmabanka.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



view thread (2+ messages)

Message-ID: <12650.1048259449@sss.pgh.pa.us>
Permalink:  ../12650.1048259449@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12650.1048259449@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, viy@pirmabanka.lv
  Subject: Re: psql invokation
  In-Reply-To: <12650.1048259449@sss.pgh.pa.us>
  References: <20030321140145.GE20481@pirmabanka.lv> <12650.1048259449@sss.pgh.pa.us>

* 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