pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 周仁军 <zrj@shanda.com.cn>
To: David F. Skoll <dfs@roaringpenguin.com>
To: Charles Haron <charles.haron@cognitive.com>
Cc: pgsql-admin@postgresql.org
Subject: 答复: [ADMIN] How to use psql -c?
Date: Tue, 30 Dec 2003 10:19:39 +0800
Message-ID: <EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn> (raw)
In-Reply-To: <Pine.LNX.4.58.0312291722410.14524@shishi.roaringpenguin.com>

           u's PATH have no problem?

-----原始邮件-----
发件人: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]代表 David F. Skoll
发送时间: 2003年12月30日 6:24
收件人: Charles Haron
抄送: pgsql-admin@postgresql.org
主题: Re: [ADMIN] How to use psql -c?


On Mon, 29 Dec 2003, Charles Haron wrote:

> I want to be able to run the above command as a cron job.  I created a
> script with the following command, but I get "ERROR:  Attribute 'f' not
> found":
> su - postgres -c 'psql  -c "DELETE FROM prg_dates_members WHERE confirm =
> 'f';" comfire'

Why not avoid shell quoting problems by doing it like this:

su - postgres -c psql comfire <<EOF
DELETE FROM prg_dates_members WHERE confirm = 'f';
EOF

Regards,

David.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 2003-12-26

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 2003-12-26
 


Message-ID: <EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn>
Permalink:  ../EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn/
Also on:    postgresql.org/message-id/EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn

 · 

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: zrj@shanda.com.cn, dfs@roaringpenguin.com, charles.haron@cognitive.com
  Subject: Re: 答复: [ADMIN] How to use psql -c?
  In-Reply-To: <EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn>
  References: <Pine.LNX.4.58.0312291722410.14524@shishi.roaringpenguin.com> <EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn>

* 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