Re: INSERT ... RETURNING in v8.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: INSERT ... RETURNING in v8.2
Дата
Msg-id 8539.1181665244@sss.pgh.pa.us
обсуждение исходный текст
Ответ на INSERT ... RETURNING in v8.2  (Vincenzo Romano <vincenzo.romano@gmail.com>)
Список pgsql-general
Vincenzo Romano <vincenzo.romano@gmail.com> writes:
> Well, at least on v8.2.4 I cannot return count(*), that is the
> number of lines actually inserted into the table. Nor I can return
> any aggregate function of them.
> Am I doing anything wrong or is there some missing sentence in the
> documentation?

I would think the error message you get would make it pretty plain
that this wasn't just an oversight:

regression=# insert into int4_tbl default values returning count(*);
ERROR:  cannot use aggregate function in RETURNING

RETURNING is supposed to return one row per inserted/deleted/updated
tuple, so what you suggest isn't sensible.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PL/PGSQL rowtype return problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: INSERT ... RETURNING in v8.2