From: Charles Haron <charles.haron@cognitive.com>
To: pgsql-admin@postgresql.org
Subject: Re: How to use psql -c?
Date: Mon, 29 Dec 2003 14:37:57 -0700
Message-ID: <BC15ECC5.856%charles.haron@cognitive.com> (raw)
In-Reply-To: <20031229140613.A20733@quality.qadas.com>
> From: Michael Fuhr <mike@fuhr.org>
> Date: Mon, 29 Dec 2003 14:06:13 -0700
> To: Charles Haron <charles.haron@cognitive.com>
> 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/
>
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: charles.haron@cognitive.com
Subject: Re: How to use psql -c?
In-Reply-To: <BC15ECC5.856%charles.haron@cognitive.com>
References: <20031229140613.A20733@quality.qadas.com> <BC15ECC5.856%charles.haron@cognitive.com>
* 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