]> granicus.if.org Git - postgresql/commit
Fix handling of auto-updatable views on inherited tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 3 Jul 2013 16:26:33 +0000 (12:26 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 3 Jul 2013 16:26:33 +0000 (12:26 -0400)
commit654b702a1c01fa047a363a887f957886503ea67c
tree2cfc3904e85f6dce92bd516b9051abfb19976209
parentc21bb48d6fc1827e117e2667e0a5d9d96d984f46
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
src/backend/rewrite/rewriteHandler.c
src/test/regress/expected/updatable_views.out
src/test/regress/sql/updatable_views.sql