View Single Post

   
  #4 (permalink)  
Old 04-09-2008, 05:50 PM
Tom Lane
 
Posts: n/a
Default Re: INSERT ... RETURNING in v8.2

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote