1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

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
This commit is contained in:
Robert Haas
2013-10-18 10:35:36 -04:00
parent 523beaa11b
commit cab5dc5daf
8 changed files with 701 additions and 178 deletions

View File

@ -8806,7 +8806,8 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
if (check_option)
{
const char *view_updatable_error =
view_query_is_auto_updatable(view_query, security_barrier);
view_query_is_auto_updatable(view_query,
security_barrier, true);
if (view_updatable_error)
ereport(ERROR,