Re: proposal - assign result of query to psql variable

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal - assign result of query to psql variable
Дата
Msg-id 12017.1343280977@sss.pgh.pa.us
обсуждение исходный текст
Ответ на proposal - assign result of query to psql variable  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal - assign result of query to psql variable  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: proposal - assign result of query to psql variable  (David Fetter <david@fetter.org>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> \eset variable [, variable [..]] query --  it raise exception when
> more than one row is returned or when no row is returned

Better would be a variant on \g, that is you type in the query and
then tell it where to put the result.  We have learned the hard way
that putting SQL commands into the arguments of backslash commands
is a horrid idea.  Maybe
select x,y,... from ...\gset var1 var2 ...
        regards, tom lane


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: proposal - assign result of query to psql variable
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal - assign result of query to psql variable