Created
October 4, 2010 02:31
-
-
Save taotetek/609180 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 FUNCTION beam_me_up() RETURNS TRIGGER AS $$ | |
require 'yaml' | |
payload = new.to_yaml | |
$Plans["engage"] = PL::Plan.new("NOTIFY watchers, '#{payload}'") | |
$Plans["engage"].exec() | |
$$ LANGUAGE 'plruby'; | |
CREATE TRIGGER beam_me_up_trigger AFTER INSERT ON watched_table | |
FOR EACH ROW EXECUTE PROCEDURE beam_me_up(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment