pgsql: Fix handling of auto-updatable views on inherited tables.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix handling of auto-updatable views on inherited tables.
Date: 2013-07-03 16:27:10
Message-ID: E1UuPte-0008Cg-3v@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix handling of auto-updatable views on inherited tables.

An INSERT into such a view should work just like an INSERT into its base
table, ie the insertion should go directly into that table ... not be
duplicated into each child table, as was happening before, per bug #8275
from Rushabh Lathia. On the other hand, the current behavior for
UPDATE/DELETE seems reasonable: the update/delete traverses the child
tables, or not, depending on whether the view specifies ONLY or not.
Add some regression tests covering this area.

Dean Rasheed

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5530a826434a8d4bc6ba7387d05aa14755406199

Modified Files
--------------
src/backend/rewrite/rewriteHandler.c | 7 ++
src/test/regress/expected/updatable_views.out | 100 +++++++++++++++++++++++++
src/test/regress/sql/updatable_views.sql | 32 ++++++++
3 files changed, 139 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-07-03 16:36:24 pgsql: Hopefully-portable regression tests for CREATE/ALTER/DROP COLLAT
Previous Message Alvaro Herrera 2013-07-03 15:09:23 pgsql: Unbreak postmaster restart-after-crash sequence