mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +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:
@ -22,12 +22,12 @@ create unique index pkeys_i on pkeys (pkey1, pkey2);
|
||||
create trigger check_fkeys_pkey_exist
|
||||
before insert or update on fkeys
|
||||
for each row
|
||||
execute procedure
|
||||
execute function
|
||||
check_primary_key ('fkey1', 'fkey2', 'pkeys', 'pkey1', 'pkey2');
|
||||
create trigger check_fkeys_pkey2_exist
|
||||
before insert or update on fkeys
|
||||
for each row
|
||||
execute procedure check_primary_key ('fkey3', 'fkeys2', 'pkey23');
|
||||
execute function check_primary_key ('fkey3', 'fkeys2', 'pkey23');
|
||||
--
|
||||
-- For fkeys2:
|
||||
-- (fkey21, fkey22) --> pkeys (pkey1, pkey2)
|
||||
|
@ -26,13 +26,13 @@ create unique index pkeys_i on pkeys (pkey1, pkey2);
|
||||
create trigger check_fkeys_pkey_exist
|
||||
before insert or update on fkeys
|
||||
for each row
|
||||
execute procedure
|
||||
execute function
|
||||
check_primary_key ('fkey1', 'fkey2', 'pkeys', 'pkey1', 'pkey2');
|
||||
|
||||
create trigger check_fkeys_pkey2_exist
|
||||
before insert or update on fkeys
|
||||
for each row
|
||||
execute procedure check_primary_key ('fkey3', 'fkeys2', 'pkey23');
|
||||
execute function check_primary_key ('fkey3', 'fkeys2', 'pkey23');
|
||||
|
||||
--
|
||||
-- For fkeys2:
|
||||
|
Reference in New Issue
Block a user