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