Tom Lane wrote:

ISTM that in most cases where this is a serious issue, the trigger
functions are doing the *same* thing to different tables.  Not just
textually the same, but datatype-wise the same.  So I'm not sure I
believe that we need to be able to "switch out types".  Maybe it would
work to devise a notation that allows fetching or storing a field that
has a runtime-determined name, but prespecifies the field type.
Actually only the "fetch" end of it is an issue, since when storing the
field datatype can be inferred from the expression you're trying to
assign to the field.

                        

That's exactly the sort of thing I had in mind. I wasn't talking about loosening the type system. Classic case: you want to set/update a timestamp field in the NEW record, but it might not be called the same thing on each table, so you pass the field name as a trigger argument.

cheers

andrew

--
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