relation points at a subquery range-table entry, which will not
work. There are several ways in which
PostgreSQL
can support the appearance of updating a view, however.
+ In order of user-experienced complexity those are: automatically substitute
+ in the underlying table for the view, execute a user-defined trigger,
+ or rewrite the query per a user-defined rule.
+ These options are discussed below.
Alternatively, the operation may be handled by a user-provided
- INSTEAD OF trigger on the view.
+ INSTEAD OF trigger on the view
+ (see ).
Rewriting works slightly differently
in this case. For INSERT, the rewriter does
nothing at all with the view, leaving it as the result relation