Re: How to define variables in psql scripts?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: How to define variables in psql scripts?
Дата
Msg-id 43DF8042.6010405@archonet.com
обсуждение исходный текст
Ответ на How to define variables in psql scripts?  ("Kynn Jones" <kynnjo@gmail.com>)
Список pgsql-general
Kynn Jones wrote:
> << kj314159265358979 >>
>
> I know that one can store multiple psql commands and SQL statements in
> a separate "script" file, and then "source" the script file, e.g. with
> the \i command.
>
> My question is, can I define variables in such a script file?  E.g. can
> I do something like the following unix-shell-like script?

You can use psql variables
http://www.postgresql.org/docs/8.1/static/app-psql.html#APP-PSQL-VARIABLES

Be careful with quoting issues though.
--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: nboutelier@hotmail.com
Дата:
Сообщение: Can't get the field = ANY(array) clause to work...
Следующее
От: "P. Scott DeVos"
Дата:
Сообщение: plpython error logs