X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BE2D5D1CA71 for ; Mon, 29 Dec 2003 21:44:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 89276-02 for ; Mon, 29 Dec 2003 17:44:00 -0400 (AST) Received: from cog-mail.csi (mail.cognitive.com [12.45.111.163]) by svr1.postgresql.org (Postfix) with ESMTP id 490A7D1B49E for ; Mon, 29 Dec 2003 17:37:41 -0400 (AST) Received: from [67.164.160.155] (172.31.3.11 [172.31.3.11]) by cog-mail.csi with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id ZNDZJD9Z; Mon, 29 Dec 2003 14:38:32 -0700 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Mon, 29 Dec 2003 14:37:57 -0700 Subject: Re: How to use psql -c? From: Charles Haron To: Message-ID: In-Reply-To: <20031229140613.A20733@quality.qadas.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/329 X-Sequence-Number: 11835 > From: Michael Fuhr > Date: Mon, 29 Dec 2003 14:06:13 -0700 > To: Charles Haron > Cc: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] How to use psql -c? > > On Mon, Dec 29, 2003 at 01:49:00PM -0700, Charles Haron wrote: >> >> Can someone give me an example of how to use the -c option of psql? I can't >> seem to get it to work. > > What are you doing and what are the results? We can't tell you what's > wrong unless you show us what you're doing and what's happening. > Learning why something doesn't work can be just as useful as learning > how to make it work. > My first problem was that I was using single quotes instead of double quotes. But now I have another problem. The following command works as I want: psql -c "DELETE FROM prg_dates_members WHERE confirm = 'f';" comfire 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' What am I doing wrong? Is there a better way to do this? Thanks, Chuck > -- > Michael Fuhr > http://www.fuhr.org/~mfuhr/ >