Re: INSERT ... RETURNING in v8.2 - Mailing list pgsql-general

From Tom Lane
Subject Re: INSERT ... RETURNING in v8.2
Date
Msg-id 8614.1181665595@sss.pgh.pa.us
Whole thread Raw
In response to Re: INSERT ... RETURNING in v8.2  (Vincenzo Romano <vincenzo.romano@gmail.com>)
Responses Re: INSERT ... RETURNING in v8.2  (Vincenzo Romano <vincenzo.romano@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: INSERT ... RETURNING in v8.2
Next
From: Vincenzo Romano
Date:
Subject: Re: INSERT ... RETURNING in v8.2