aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-10-01 23:02:55 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-10-01 23:02:55 +0200
commitcf3dfea45b13662b3c23d7c481a9f77d67e77c45 (patch)
tree4c1bfc3fc76de821c22295977c716cad62acfb74
parentb04aeb0a053e7cf7faad89f7d47844d8ba0dc839 (diff)
downloadpostgresql-cf3dfea45b13662b3c23d7c481a9f77d67e77c45.tar.gz
postgresql-cf3dfea45b13662b3c23d7c481a9f77d67e77c45.zip
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.)
-rw-r--r--src/backend/parser/gram.y4
-rw-r--r--src/test/regress/expected/event_trigger.out2
-rw-r--r--src/test/regress/sql/event_trigger.sql2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index d41eecd5bd5..ce60e99cff5 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 008e859d4c2..6175a10d778 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 ef7faf0ab76..342aef64497 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