Created
July 10, 2012 05:40
-
-
Save cecilemuller/3081382 to your computer and use it in GitHub Desktop.
PostgreSQL trigger: loop through the columns of the source table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
_name text; | |
BEGIN | |
FOR _name IN SELECT column_name FROM information_schema.Columns WHERE table_schema = TG_TABLE_SCHEMA AND table_name = TG_TABLE_NAME LOOP | |
RAISE NOTICE 'Column is %', _name; | |
END LOOP; | |
RETURN NEW; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment