[patch] [doc] Introduce view updating options more succinctly

Started by David G. Johnstonabout 5 years ago3 messages
#1David G. Johnston
david.g.johnston@gmail.com
1 attachment(s)

Hackers,

Over in -docs [1]/messages/by-id/20200303174248.GB5019@panix.com, where I attached the wrong patch anyway, the poster
needed some clarity regarding view updating. A minor documentation patch
is attached providing just that.

David J.

[1]: /messages/by-id/20200303174248.GB5019@panix.com

Attachments:

v1-doc-rules-view-updating-touchup.patchapplication/octet-stream; name=v1-doc-rules-view-updating-touchup.patchDownload
commit ec9a8047815276f9119dbb9fda409fef62c72de7
Author: David G. Johnston <david.g.johnston@gmail.com>
Date:   Fri Oct 2 20:31:02 2020 +0000

    doc: Introduce view updating options more succinctly

diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml
index bcf860b68b..431f44a248 100644
--- a/doc/src/sgml/rules.sgml
+++ b/doc/src/sgml/rules.sgml
@@ -797,6 +797,10 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
     relation points at a subquery range-table entry, which will not
     work.  There are several ways in which <productname>PostgreSQL</productname>
     can support the appearance of updating a view, however.
+    In order of user-experienced complexity those are: automatically substitute
+    in the underlying table for the view, execute a user-defined trigger,
+    or rewrite the query per a user-defined rule.
+    These options are discussed below.
 </para>
 
 <para>
@@ -812,7 +816,8 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
 
 <para>
     Alternatively, the operation may be handled by a user-provided
-    <literal>INSTEAD OF</literal> trigger on the view.
+    <literal>INSTEAD OF</literal> trigger on the view
+    (see <xref linkend="sql-createtrigger"/>).
     Rewriting works slightly differently
     in this case.  For <command>INSERT</command>, the rewriter does
     nothing at all with the view, leaving it as the result relation
#2Anastasia Lubennikova
a.lubennikova@postgrespro.ru
In reply to: David G. Johnston (#1)
Re: [patch] [doc] Introduce view updating options more succinctly

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation: tested, passed

I wonder, why this patch didn't get a review during the CF.
This minor improvement looks good to me, so I mark it Ready for Committer.

The new status of this patch is: Ready for Committer

#3Magnus Hagander
magnus@hagander.net
In reply to: Anastasia Lubennikova (#2)
Re: [patch] [doc] Introduce view updating options more succinctly

On Mon, Nov 30, 2020 at 9:22 PM Anastasia Lubennikova
<a.lubennikova@postgrespro.ru> wrote:

I wonder, why this patch didn't get a review during the CF.
This minor improvement looks good to me, so I mark it Ready for Committer.

Agreed, and how it managed to pass multiple CFs without getting applied :)

I've applied it now. Thanks, David!

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/