Details
-
Technical task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Add support for TRIGGER events that can fire for one or many of
INSERT, UPDATE and DELETE
The current syntax for triggers are:
CREATE [OR REPLACE]
|
[DEFINER = { user | CURRENT_USER }]
|
TRIGGER [IF NOT EXISTS] trigger_name trigger_time trigger_event
|
ON tbl_name FOR EACH ROW trigger_stmt
|
The task is to replace trigger_event with:
{ event [ OR ... ] }
|
Oracle and PostgreSQL both support this extension to CREATE TRIGGER.
PostgreSQL solves the issue witth information schema by duplicating the trigger for as many times as there are events.The primary key of the view triggers is because of this trigger_catalog, trigger_schema, event_object_table, trigger_name, event.
To distinguish which event fired the trigger, Oracle supports event flags:
CREATE TRIGGER tr1 |
BEFORE DELETE OR INSERT OR UPDATE ON t1 |
FOR EACH ROW |
BEGIN
|
IF INSERTING THEN ... |
ELSIF DELETING THEN ... |
ELSIF UPDATING THEN ... |
ENDIF;
|
END; |
We should also support this.
Attachments
Issue Links
- blocks
-
MDEV-34569 Oracle compatibility project 4
- Open