Created
March 26, 2014 14:36
-
-
Save anonymous/9784814 to your computer and use it in GitHub Desktop.
This file contains 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
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