Re: How to use psql -c?

From: "David F(dot) Skoll" <dfs(at)roaringpenguin(dot)com>
To: Charles Haron <charles(dot)haron(at)cognitive(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to use psql -c?
Date: 2003-12-29 22:23:53
Message-ID: Pine.LNX.4.58.0312291722410.14524@shishi.roaringpenguin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Regards,

David.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message William Yu 2003-12-29 22:36:19 Re: IEEE 754
Previous Message Charles Haron 2003-12-29 21:37:57 Re: How to use psql -c?