Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics
Дата
Msg-id 5595.1526919652@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics  (Alexey Dokuchaev <danfe@nsu.ru>)
Ответы Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics  (Alexey Dokuchaev <danfe@nsu.ru>)
Список pgsql-general
Alexey Dokuchaev <danfe@nsu.ru> writes:
> On Mon, May 21, 2018 at 10:45:27AM -0400, Tom Lane wrote:
>> OP could do something like
>>     select json_agg(_) as j, count(*) as c INTO r FROM (

> Thanks, I've arrived at the same solution (using local RECORD) eventually.
> It works as intended, but I still need to assign OUT parameters by hand:

>     retcode := tmp.c;
>     result := tmp.j;

Actually, it should work to do

    select json_agg(_), count(*) INTO result, retcode FROM ...

            regards, tom lane


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

Предыдущее
От: Alvaro Aguayo Garcia-Rada
Дата:
Сообщение: Re: Will Altering and Modifying tables during backup result in acorrupted server after the restore?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Will Altering and Modifying tables during backup result in acorrupted server after the restore?