Re: Interpolation of environment variables in SQL at runtime?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interpolation of environment variables in SQL at runtime?
Дата
Msg-id 27811.1099236666@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Interpolation of environment variables in SQL at runtime?  (Andy Gimblett <A.M.Gimblett@swansea.ac.uk>)
Список pgsql-general
Andy Gimblett <A.M.Gimblett@swansea.ac.uk> writes:
> Question: is there any way to use environment variables (or something
> similar) in my saved SQL code, and have them expanded at runtime?

Only by preprocessing the script.  Have you considered something like

cat <<EOF
... WHERE $foo = ...
EOF | psql ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: View's rule on delete problem
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: View's rule on delete problem