Optional REFERENCES Feature in CREATE TRIGGER Command - Mailing list pgsql-patches

From hyip@site.uottawa.ca
Subject Optional REFERENCES Feature in CREATE TRIGGER Command
Date
Msg-id 1413.127.0.0.1.1102452995.squirrel@127.0.0.1
Whole thread Raw
Responses Re: Optional REFERENCES Feature in CREATE TRIGGER Command
Re: Optional REFERENCES Feature in CREATE TRIGGER Command
List pgsql-patches
Hi,

The attached patch adds the optional REFERENCES syntax in CREATE TRIGGER
statement to make an automatic alias for OLD/NEW record during trigger
setup.  The implementation of this new feature makes CREATE TRIGGER
command more compatible to SQL standard, and allows the future
implementation of executing SQL commands in trigger action.

After the implementation, the extended syntax of statement is as follows.

CREATE TRIGGER name BEFORE|AFTER
    INSERT|DELETE|UPDATE [OR...] ON tablename
    [REFERENCING OLD|NEW [AS] identifier]
    [FOR [EACH] ROW|STATEMENT]
    EXECUTE PROCEDURE funcname (arguments)

The patch will also update two columns, condition_reference_old_table and
condition_reference_new_table with alias names of the OLD/NEW record in
the Triggers table of the information schema.

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_get_viewdef returns one paren too much
Next
From: Bruce Momjian
Date:
Subject: Re: Optional REFERENCES Feature in CREATE TRIGGER Command