Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2003
    Location
    SW London
    Posts
    5

    Unanswered: PL/PGSQL - triggers, dynamic fetching column names/types in NEW

    Hi,

    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?
    Last edited by jgbreezer; 11-03-03 at 12:51.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •