X-Original-To: pgsql-admin@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 722D2475AFF for ; Fri, 21 Mar 2003 10:10:50 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2LFAnub012651; Fri, 21 Mar 2003 10:10:49 -0500 (EST) To: "Victor Yegorov" Cc: "Postgres Admin" Subject: Re: psql invokation In-reply-to: <20030321140145.GE20481@pirmabanka.lv> References: <20030321140145.GE20481@pirmabanka.lv> Comments: In-reply-to "Victor Yegorov" message dated "Fri, 21 Mar 2003 16:01:45 +0200" Date: Fri, 21 Mar 2003 10:10:49 -0500 Message-ID: <12650.1048259449@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/340 X-Sequence-Number: 7980 "Victor Yegorov" 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