Excerpts from Merlin Moncure's message of mar nov 09 16:41:32 -0300 2010:
> The only exception I see is in trigger functions. If the trigger
> function plan is specific to the firing trigger, new and old are
> defined at plan time, so something like:
>
> new{TG_FIELDNAMES[1]} = 5; -- is ok (at least IMO), since
> TG_FIELDNAMES is immutable (at least to the plan).
>
> I don't honestly know if it's worth it -- the main case is performance
> (plus Pavel's secondary argument of loss of type information).
> Something like this would address an awful lot of gripes about trigger
> functions though.
I think the interesting bit (wrt the examples I've seen, that is) would
be to be able to use the TG_ARGS array as the element specifier. Not
sure if this is any different from your example. It's been some time
since I've been near this though, so maybe what I wanted is now possible
with USING tricks.
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support