Skip to content

Instantly share code, notes, and snippets.

/gist:9784814
Created Mar 26, 2014

Embed
What would you like to do?
CREATE LANGUAGE plpgsql;
CREATE FUNCTION myinsert() RETURNS trigger AS $$
BEGIN
IF NEW.name <> 'DUMMY' THEN
insert into names (name) values ('DUMMY');
END IF;
RETURN NULL;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER mytrig AFTER INSERT ON names
FOR EACH ROW
EXECUTE PROCEDURE myinsert();
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.