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