]> granicus.if.org Git - postgresql/commitdiff
Change PROCEDURE to FUNCTION in CREATE EVENT TRIGGER syntax
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 1 Oct 2018 21:02:55 +0000 (23:02 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 1 Oct 2018 21:02:55 +0000 (23:02 +0200)
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
src/test/regress/expected/event_trigger.out
src/test/regress/sql/event_trigger.sql

index d41eecd5bd59e803c22b11368b591c877e23165f..ce60e99cff5e3618bd5da0982c31c18f2a46200d 100644 (file)
@@ -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;
index 008e859d4c2f4f287de5777b599eab24a4d888e6..6175a10d7786feb14cc47b83cf30a49a4d6adfe1 100644 (file)
@@ -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')
index ef7faf0ab76324b610a20b455d73fa4aa22e62ae..342aef6449743403840771e610a8803bb1c43323 100644 (file)
@@ -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