Skip to content
Snippets Groups Projects
Commit 5e1fead7 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

BugID: 991

Reverted to the previous "one-type-catch-all" insert_result trigger. There
currently is no need for different insert_result triggers.
parent 8c10ba1d
No related branches found
No related tags found
No related merge requests found
CREATE OR REPLACE FUNCTION blackboard.notify() RETURNS TRIGGER AS
CREATE OR REPLACE FUNCTION blackboard.notify_client() RETURNS TRIGGER AS
$$
BEGIN
EXECUTE 'NOTIFY ' || quote_ident(TG_NAME);
......@@ -7,27 +7,10 @@ $$
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION blackboard.notify_result() RETURNS TRIGGER AS
$$
DECLARE
cmd_type TEXT;
BEGIN
cmd_type := "Type" FROM blackboard.command WHERE id = NEW.command_id;
IF cmd_type ~ '^initialize$|^finalize$|^nextchunk$' THEN
-- RAISE NOTICE 'NOTIFY %', quote_ident(TG_NAME) || '_' || cmd_type;
EXECUTE 'NOTIFY ' || quote_ident(TG_NAME || '_' || cmd_type);
END IF;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
CREATE TRIGGER insert_command
AFTER INSERT ON blackboard.command
FOR EACH STATEMENT EXECUTE PROCEDURE blackboard.notify();
FOR EACH STATEMENT EXECUTE PROCEDURE blackboard.notify_client();
CREATE TRIGGER insert_result
AFTER INSERT ON blackboard.result
FOR EACH ROW EXECUTE PROCEDURE blackboard.notify_result();
FOR EACH STATEMENT EXECUTE PROCEDURE blackboard.notify_client();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment