From cf3dfea45b13662b3c23d7c481a9f77d67e77c45 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 1 Oct 2018 23:02:55 +0200 Subject: [PATCH] Change PROCEDURE to FUNCTION in CREATE EVENT TRIGGER syntax This was claimed to have been done in 0a63f996e018ac508c858e87fa39cc254a5db49f, but that actually only changed the documentation and not the grammar. (That commit did fully change it for CREATE TRIGGER.) --- src/backend/parser/gram.y | 4 ++-- src/test/regress/expected/event_trigger.out | 2 +- src/test/regress/sql/event_trigger.sql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index d41eecd5bd..ce60e99cff 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -5578,7 +5578,7 @@ ConstraintAttributeElem: CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel - EXECUTE PROCEDURE func_name '(' ')' + EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = $4; @@ -5589,7 +5589,7 @@ CreateEventTrigStmt: } | CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list - EXECUTE PROCEDURE func_name '(' ')' + EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = $4; diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out index 008e859d4c..6175a10d77 100644 --- a/src/test/regress/expected/event_trigger.out +++ b/src/test/regress/expected/event_trigger.out @@ -27,7 +27,7 @@ create event trigger regress_event_trigger on ddl_command_start execute procedure test_event_trigger(); -- OK create event trigger regress_event_trigger_end on ddl_command_end - execute procedure test_event_trigger(); + execute function test_event_trigger(); -- should fail, food is not a valid filter variable create event trigger regress_event_trigger2 on ddl_command_start when food in ('sandwich') diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql index ef7faf0ab7..342aef6449 100644 --- a/src/test/regress/sql/event_trigger.sql +++ b/src/test/regress/sql/event_trigger.sql @@ -28,7 +28,7 @@ create event trigger regress_event_trigger on ddl_command_start -- OK create event trigger regress_event_trigger_end on ddl_command_end - execute procedure test_event_trigger(); + execute function test_event_trigger(); -- should fail, food is not a valid filter variable create event trigger regress_event_trigger2 on ddl_command_start -- 2.40.0