pgsql: Allow only some columns of a view to be auto-updateable.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow only some columns of a view to be auto-updateable.
Date: 2013-10-18 14:42:37
Message-ID: E1VXBG9-0005pA-6k@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2013-10-19 01:28:56 pgsql: Move pgfnames() from libpgport to libpgcommon
Previous Message Robert Haas 2013-10-18 14:26:29 pgsql: Provide a reliable mechanism for terminating a background worker