mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Change PROCEDURE to FUNCTION in CREATE TRIGGER syntax
Since procedures are now a different thing from functions, change the CREATE TRIGGER and CREATE EVENT TRIGGER syntax to use FUNCTION in the clause that specifies the function. PROCEDURE is still accepted for compatibility. pg_dump and ruleutils.c output is not changed yet, because that would require a change in information_schema.sql and thus a catversion change. Reported-by: Peter Geoghegan <pg@bowt.ie> Reviewed-by: Jonathan S. Katz <jonathan.katz@excoventures.com>
This commit is contained in:
@@ -789,7 +789,7 @@ $$ LANGUAGE pltcl;
|
||||
CREATE TABLE mytab (num integer, description text, modcnt integer);
|
||||
|
||||
CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab
|
||||
FOR EACH ROW EXECUTE PROCEDURE trigfunc_modcount('modcnt');
|
||||
FOR EACH ROW EXECUTE FUNCTION trigfunc_modcount('modcnt');
|
||||
</programlisting>
|
||||
|
||||
Notice that the trigger function itself does not know the column
|
||||
@@ -852,7 +852,7 @@ CREATE OR REPLACE FUNCTION tclsnitch() RETURNS event_trigger AS $$
|
||||
elog NOTICE "tclsnitch: $TG_event $TG_tag"
|
||||
$$ LANGUAGE pltcl;
|
||||
|
||||
CREATE EVENT TRIGGER tcl_a_snitch ON ddl_command_start EXECUTE PROCEDURE tclsnitch();
|
||||
CREATE EVENT TRIGGER tcl_a_snitch ON ddl_command_start EXECUTE FUNCTION tclsnitch();
|
||||
</programlisting>
|
||||
</para>
|
||||
</sect1>
|
||||
|
Reference in New Issue
Block a user