Allow only some columns of a view to be auto-updateable.
Robert Haas <rhaas@postgresql.org>
Allow only some columns of a view to be auto-updateable. Previously, unless all columns were auto-updateable, we wouldn't inserts, updates, or deletes, or at least not without a rule or trigger; now, we'll allow inserts and updates that target only the auto-updateable columns, and deletes even if there are no auto-updateable columns at all provided the view definition is otherwise suitable. Dean Rasheed, reviewed by Marko Tiikkaja
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/create_view.sgml | modified | +29 −10 |
| src/backend/commands/tablecmds.c | modified | +2 −1 |
| src/backend/commands/view.c | modified | +1 −1 |
| src/backend/rewrite/rewriteHandler.c | modified | +303 −103 |
| src/backend/utils/adt/misc.c | modified | +6 −7 |
| src/include/rewrite/rewriteHandler.h | modified | +5 −3 |
| src/test/regress/expected/updatable_views.out | modified | +256 −42 |
| src/test/regress/sql/updatable_views.sql | modified | +99 −11 |