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 CE351D1B455 for ; Mon, 29 Dec 2003 22:54:32 +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 99699-05 for ; Mon, 29 Dec 2003 18:53:46 -0400 (AST) Received: from cog-mail.csi (mail.cognitive.com [12.45.111.163]) by svr1.postgresql.org (Postfix) with ESMTP id 758B1D1B45C for ; Mon, 29 Dec 2003 18:53:43 -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 ZNDZJ1HC; Mon, 29 Dec 2003 15:54:35 -0700 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Mon, 29 Dec 2003 15:53:59 -0700 Subject: Re: How to use psql -c? From: Charles Haron To: "David F. Skoll" Cc: Message-ID: In-Reply-To: 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/331 X-Sequence-Number: 11837 > From: "David F. Skoll" > Date: Mon, 29 Dec 2003 17:23:53 -0500 (EST) > To: Charles Haron > Cc: pgsql-admin@postgresql.org > Subject: 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 < DELETE FROM prg_dates_members WHERE confirm = 'f'; > EOF > If I use this as is I get: EOF: command not found > Regards, > > David. >