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

Support automatically-updatable views.

This patch makes "simple" views automatically updatable, without the need
to create either INSTEAD OF triggers or INSTEAD rules.  "Simple" views
are those classified as updatable according to SQL-92 rules.  The rewriter
transforms INSERT/UPDATE/DELETE commands on such views directly into an
equivalent command on the underlying table, which will generally have
noticeably better performance than is possible with either triggers or
user-written rules.  A view that has INSTEAD OF triggers or INSTEAD rules
continues to operate the same as before.

For the moment, security_barrier views are not considered simple.
Also, we do not support WITH CHECK OPTION.  These features may be
added in future.

Dean Rasheed, reviewed by Amit Kapila
This commit is contained in:
Tom Lane
2012-12-08 18:25:48 -05:00
parent d12d9f595e
commit a99c42f291
20 changed files with 2492 additions and 94 deletions

View File

@@ -147,11 +147,9 @@ ALTER TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable>
<listitem>
<para>
These forms set or remove the default value for a column.
The default values only apply to subsequent <command>INSERT</command>
commands; they do not cause rows already in the table to change.
Defaults can also be created for views, in which case they are
inserted into <command>INSERT</> statements on the view before
the view's <literal>ON INSERT</literal> rule is applied.
Default values only apply in subsequent <command>INSERT</command>
or <command>UPDATE</> commands; they do not cause rows already in the
table to change.
</para>
</listitem>
</varlistentry>