Re: proposal - assign result of query to psql variable

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal - assign result of query to psql variable
Дата
Msg-id CAFj8pRAjcoXRBNMUFPJ5apjaMD14=yAsiYuLenArpX0tZhnkOA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal - assign result of query to psql variable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2012/7/26 Tom Lane <tgl@sss.pgh.pa.us>:
> 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 ...

it could be

Pavel

>
>                         regards, tom lane


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

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