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
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/cab5dc5daf2f6f5da0ce79deb399633b4bb443b5
Modified Files
--------------
doc/src/sgml/ref/create_view.sgml | 39 ++-
src/backend/commands/tablecmds.c | 3 +-
src/backend/commands/view.c | 2 +-
src/backend/rewrite/rewriteHandler.c | 406 ++++++++++++++++++-------
src/backend/utils/adt/misc.c | 13 +-
src/include/rewrite/rewriteHandler.h | 8 +-
src/test/regress/expected/updatable_views.out | 298 +++++++++++++++---
src/test/regress/sql/updatable_views.sql | 110 ++++++-
8 files changed, 701 insertions(+), 178 deletions(-)