Re: How to use psql -c?

Поиск
Список
Период
Сортировка
От Hans Peter Wiedau
Тема Re: How to use psql -c?
Дата
Msg-id 20031230100709.GA1937@entoron.wiedau.de
обсуждение исходный текст
Ответ на Re: How to use psql -c?  (Charles Haron <charles.haron@cognitive.com>)
Ответы Re: How to use psql -c?  (Charles Haron <charles.haron@cognitive.com>)
Список pgsql-admin
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

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Uwe C. Schroeder"
Дата:
Сообщение: Re: switching from windows to linux
Следующее
От: "vidhya"
Дата:
Сообщение: remote access to linux