Created
February 11, 2014 11:03
-
-
Save petrushev/8932942 to your computer and use it in GitHub Desktop.
tickets notifications
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
CREATE OR REPLACE FUNCTION trigger_notify() | |
RETURNS trigger AS | |
$BODY$ | |
BEGIN | |
IF NEW.state = 'pending' THEN | |
EXECUTE 'NOTIFY tickets_pending'||NEW.id::text; | |
RETURN NULL; | |
END IF; | |
END; | |
$BODY$ | |
LANGUAGE plpgsql VOLATILE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment