答复: [ADMIN] How to use psql -c?
От | 周仁军 |
---|---|
Тема | 答复: [ADMIN] How to use psql -c? |
Дата | |
Msg-id | EMEILKNNMPPPHHJAFGIEAELFCHAA.zrj@shanda.com.cn обсуждение исходный текст |
Ответ на | Re: How to use psql -c? ("David F. Skoll" <dfs@roaringpenguin.com>) |
Список | 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 по дате отправления: