Re: INSERT ... RETURNING in v8.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT ... RETURNING in v8.2
Date: 2007-06-12 16:26:35
Message-ID: 8614.1181665595@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2007-06-12 16:36:11 Re: how to speed up query
Previous Message Tom Lane 2007-06-12 16:20:44 Re: INSERT ... RETURNING in v8.2