答复: [ADMIN] How to use psql -c? - Mailing list pgsql-admin

From 周仁军
Subject 答复: [ADMIN] How to use psql -c?
Date
Msg-id EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn
Whole thread Raw
In response to Re: How to use psql -c?  ("David F. Skoll" <dfs@roaringpenguin.com>)
List pgsql-admin
           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
 

pgsql-admin by date:

Previous
From: William Yu
Date:
Subject: Re: IEEE 754
Next
From: vidhya baskaran
Date:
Subject: switching from windows to linux