psql client: technique for applying default values to :variables?

Поиск
Список
Период
Сортировка
От Jeff Boes
Тема psql client: technique for applying default values to :variables?
Дата
Msg-id 43C55316.60403@endpoint.com
обсуждение исходный текст
Ответы Re: psql client: technique for applying default values to :variables?  (Tony Wasson <ajwasson@gmail.com>)
Список pgsql-sql
Stumped: is there any way to set up default values for psql variables
within the .SQL file itself? Obviously, I can do something like:

$ psql -f my_script -v MYVAR=${myvar:-mydefault}

but I would prefer to have the value stored with the .SQL file, e.g. (if
this actually worked):

\set MYVAR COALESCE(:MYVAR,'mydefault')

-- 
Jeffery Boes  <><
jeff@endpoint.com



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unable to identify an ordering operator '<' for type 'smallint[]'
Следующее
От: "Mauricio Fernandez A."
Дата:
Сообщение: Re: Unable to identify an ordering operator '<' for type 'smallint[]'