INSERT ... RETURNING in v8.2

From: Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: INSERT ... RETURNING in v8.2
Date: 2007-06-12 14:18:32
Message-ID: 200706121618.32613.vincenzo.romano@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.
I'm trying to use this wonderful feature (thanks to anyone who
suggested/committed/implemented it).

According to the documentation:
(http://www.postgresql.org/docs/8.2/interactive/sql-insert.html)

"The optional RETURNING clause causes INSERT to compute and return
value(s) based on each row actually inserted. This is primarily
useful for obtaining values that were supplied by defaults, such
as a serial sequence number. However, any expression using the
table's columns is allowed. The syntax of the RETURNING list is
identical to that of the output list of SELECT."

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?

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-06-12 14:35:05 Re: INSERT ... RETURNING in v8.2
Previous Message rwickert 2007-06-12 14:02:51 Re: PL/PGSQL rowtype return pr