Unanswered: PL/PGSQL - triggers, dynamic fetching column names/types in NEW
Haven't seen anything about this in the docs and a quick search here shows nothing; I'm wondering if it's possible, in pl/pgsql, to look at the NEW.. record data and see what fields are in it, and their types?
I'm using a function shared between multiple triggers and each one on a different table, and I'd like to pull out details of the fields from each one; yep, dynamic query stuff, and doable in other ways (eg. a function per table with an easily calculable name that returns appropriate bits from that table); but I'd like to keep it all in one function if I can... Tidier.
Any more suggestions?
Oh yes, and would EXECUTE work using ''NEW.appropriate_fieldname'' in the query expression somewhere, once I've got the fields?