Re: INSERT ... RETURNING in v8.2

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: INSERT ... RETURNING in v8.2
Дата
Msg-id 200706121852.51872.vincenzo.romano@gmail.com
обсуждение исходный текст
Ответ на Re: INSERT ... RETURNING in v8.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Tuesday 12 June 2007 18:26:35 Tom Lane wrote:
> Vincenzo Romano <vincenzo.romano@gmail.com> writes:
> > Second, I'm not using nested statements, but rather a plain
> > INSERT ... RETURNING COUNT(*) INTO var (it's inside a PL/PgSQL
> > function body). It should not need any GROUP BY as the query is
> > plain.
> >
> > Maybe the solution is somewhere in between what you say and what
> > I'd expect. Of course at the moment I have added an extra SELECT
> > COUNT(*) in order to get that number.
>
> Umm ... doesn't
>     GET DIAGNOSTICS integer_var = ROW_COUNT;
> do what you want?
>
>             regards, tom lane


This's a real good point, as well as the previous one.
Thanks again, Tom.

--
Vincenzo Romano
--
Maybe Computer will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: INSERT ... RETURNING in v8.2
Следующее
От: Vincenzo Romano
Дата:
Сообщение: PGSQL development tools. Any advice?