Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PostgreSQL trigger: loop through the columns of NEW record (requires `hstore` extension)
DECLARE
r record;
BEGIN
FOR r IN SELECT (each(hstore(NEW))).*
LOOP
RAISE NOTICE '% value is %', r.key, quote_nullable(r.value);
END LOOP;
RETURN NEW;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.