From: Hans Peter Wiedau <hpw-nl@quelltext.com>
To: pgsql-admin@postgresql.org
Subject: Re: How to use psql -c?
Date: Tue, 30 Dec 2003 11:07:09 +0100
Message-ID: <20031230100709.GA1937@entoron.wiedau.de> (raw)
In-Reply-To: <BC15ECC5.856%charles.haron@cognitive.com>
References: <20031229140613.A20733@quality.qadas.com>
<BC15ECC5.856%charles.haron@cognitive.com>
On Mon, Dec 29, 2003 at 02:37:57PM -0700, Charles Haron wrote:
> 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?
The bash manual page says:
A single quote may not occur between single quotes, even when
preceded by a backslash.
So, try this one:
su - postgres -c "psql -c \"DELETE FROM prg_dates_members WHERE confirm = 'f'\" comfire"
cu,
Hans Peter
--
///// Quelltext AG -- Professional Software Services
// // Hans Peter Wiedau <hpw-nl@quelltext.com>, CEO
// // Ostenhellweg 31, 44135 Dortmund, Germany
// \\/ fon +49 231 9503750, fax +49 231 9503751
////\\ Web http://www.quelltext.com
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: hpw-nl@quelltext.com
Subject: Re: How to use psql -c?
In-Reply-To: <20031230100709.GA1937@entoron.wiedau.de>
References: <20031229140613.A20733@quality.qadas.com> <BC15ECC5.856%charles.haron@cognitive.com> <20031230100709.GA1937@entoron.wiedau.de>
* 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