Vincenzo Romano <vincenzo.romano@xxxxxxxxx> 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