From: Charles Haron <charles.haron@cognitive.com>
To: David F. Skoll <dfs@roaringpenguin.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to use psql -c?
Date: Mon, 29 Dec 2003 15:53:59 -0700
Message-ID: <BC15FE97.85D%charles.haron@cognitive.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0312291722410.14524@shishi.roaringpenguin.com>
> From: "David F. Skoll" <dfs@roaringpenguin.com>
> Date: Mon, 29 Dec 2003 17:23:53 -0500 (EST)
> To: Charles Haron <charles.haron@cognitive.com>
> 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 <<EOF
> DELETE FROM prg_dates_members WHERE confirm = 'f';
> EOF
>
If I use this as is I get:
EOF: command not found
> Regards,
>
> David.
>
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, dfs@roaringpenguin.com
Subject: Re: How to use psql -c?
In-Reply-To: <BC15FE97.85D%charles.haron@cognitive.com>
References: <Pine.LNX.4.58.0312291722410.14524@shishi.roaringpenguin.com> <BC15FE97.85D%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