|
53 | 53 | <para>
|
54 | 54 | On views, triggers can be defined to execute instead of
|
55 | 55 | <command>INSERT</command>, <command>UPDATE</command>, or
|
56 |
| - <command>DELETE</command> operations. <literal>INSTEAD OF</literal> triggers |
| 56 | + <command>DELETE</command> operations. |
| 57 | + Such <literal>INSTEAD OF</literal> triggers |
57 | 58 | are fired once for each row that needs to be modified in the view.
|
58 | 59 | It is the responsibility of the
|
59 |
| - trigger's function to perform the necessary modifications to the |
60 |
| - underlying base tables and, where appropriate, return the modified |
| 60 | + trigger's function to perform the necessary modifications to the view's |
| 61 | + underlying base table(s) and, where appropriate, return the modified |
61 | 62 | row as it will appear in the view. Triggers on views can also be defined
|
62 | 63 | to execute once per <acronym>SQL</acronym> statement, before or after
|
63 | 64 | <command>INSERT</command>, <command>UPDATE</command>, or
|
64 | 65 | <command>DELETE</command> operations.
|
| 66 | + However, such triggers are fired only if there is also |
| 67 | + an <literal>INSTEAD OF</literal> trigger on the view. Otherwise, |
| 68 | + any statement targeting the view must be rewritten into a statement |
| 69 | + affecting its underlying base table(s), and then the triggers |
| 70 | + that will be fired are the ones attached to the base table(s). |
65 | 71 | </para>
|
66 | 72 |
|
67 | 73 | <para>
|
|
0 commit comments