Re: psql scripting tutorials

Поиск
Список
Период
Сортировка
От Kevin Hunter
Тема Re: psql scripting tutorials
Дата
Msg-id 48C93F83.4010302@earlham.edu
обсуждение исходный текст
Ответ на Re: psql scripting tutorials  (Harald Fuchs <hari.fuchs@gmail.com>)
Ответы Re: psql scripting tutorials  ("Roderick A. Anderson" <raanders@acm.org>)
Re: psql scripting tutorials  (Artacus <artacus@comcast.net>)
Список pgsql-general
At 7:13am -0400 on Thu, 11 Sep 2008, Harald Fuchs wrote:
> Nice trick, but when I try the following variant:
>
>   psql -v TEST=16 -c 'select :TEST as "input"'
>
> I get [a syntax error]

> This seems to be contrary to the psql manual page:

Nope.  Take a look at the -c option.  Specifically "Thus you cannot mix
SQL and psql meta-commands with this option."

You might try shell interpretation:

$ TEST=16; psql -c "select $TEST as \"input1\";"
$ TEST=16; echo "select $TEST as \"input1\";" | psql

Kevin

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: declare column update expression
Следующее
От: Tomasz Ostrowski
Дата:
Сообщение: Re: Autocommit, isolation level, and vacuum behavior