On 2010-09-23 1:16 AM, Bernd Helmle wrote:
INSERT INTO vfoo VALUES('helmle', 2) RETURNING *;
   text  | id
--------+----
  helmle |  2
(1 row)

SELECT * FROM vfoo;
  text  | id
-------+----
  bernd |  2
(1 row)

This is solvable by a properly designed trigger function, but maybe we need
to do something about this?

I really don't think we should limit what people are allowed to do in the trigger function.

Besides, even if the RETURNING clause returned 'bernd' in the above case, I think it would be even *more* surprising. The trigger function explicitly returns NEW which has 'helmle' as the first field.


Regards,
Marko Tiikkaja

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to