aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2023-11-18 12:37:40 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2023-11-18 12:37:40 +0000
commitff772853d02e274684567620fba56dd1f10f2489 (patch)
tree14fbdce62e30434d566c66961248471b92cafaef
parentaef521849b68d1eeb63c3dfbc4e92d66dc94a636 (diff)
downloadpostgresql-ff772853d02e274684567620fba56dd1f10f2489.tar.gz
postgresql-ff772853d02e274684567620fba56dd1f10f2489.zip
doc: improve description of privileges for MERGE and update glossary.
On the MERGE page, the description of the privileges required could be taken to imply that the SELECT privilege is required on all columns of the data source, whereas actually it is only required on the columns referred to by conditions or expressions in the MERGE command. Re-word it to make that a little clearer, and mention expressions as well as conditions. Also, add a glossary entry for MERGE, and nearby on the glossary page, mention MERGE in the list of commands that cannot update a materialized view. Noted by Jian He. Patch by me, reviewed by Jian He. Discussion: https://postgr.es/m/CACJufxHuSoRXKwr0MtSFLXuT2nFVWcVfEWhxg7qdP9h%2Bs3a%2BUw%40mail.gmail.com
-rw-r--r--doc/src/sgml/glossary.sgml21
-rw-r--r--doc/src/sgml/ref/merge.sgml10
2 files changed, 24 insertions, 7 deletions
diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml
index d6d0a3a8140..ada723a5227 100644
--- a/doc/src/sgml/glossary.sgml
+++ b/doc/src/sgml/glossary.sgml
@@ -990,8 +990,8 @@
(just like a <glossterm linkend="glossary-view">view</glossterm>),
but stores data in the same way that a
<glossterm linkend="glossary-table">table</glossterm> does. It cannot be
- modified via <command>INSERT</command>, <command>UPDATE</command>, or
- <command>DELETE</command> operations.
+ modified via <command>INSERT</command>, <command>UPDATE</command>,
+ <command>DELETE</command>, or <command>MERGE</command> operations.
</para>
<para>
For more information, see
@@ -1000,6 +1000,23 @@
</glossdef>
</glossentry>
+ <glossentry id="glossary-merge">
+ <glossterm>Merge</glossterm>
+ <glossdef>
+ <para>
+ An <acronym>SQL</acronym> command used to conditionally add, modify,
+ or remove <glossterm linkend="glossary-tuple">rows</glossterm>
+ in a given <glossterm linkend="glossary-table">table</glossterm>,
+ using data from a source
+ <glossterm linkend="glossary-relation">relation</glossterm>.
+ </para>
+ <para>
+ For more information, see
+ <xref linkend="sql-merge"/>.
+ </para>
+ </glossdef>
+ </glossentry>
+
<glossentry id="glossary-mvcc">
<glossterm>Multi-version concurrency control (MVCC)</glossterm>
<glossdef>
diff --git a/doc/src/sgml/ref/merge.sgml b/doc/src/sgml/ref/merge.sgml
index 0995fe0c046..d66a0626b42 100644
--- a/doc/src/sgml/ref/merge.sgml
+++ b/doc/src/sgml/ref/merge.sgml
@@ -102,14 +102,14 @@ DELETE
that are referred to in the <literal>SET</literal> clause.
If you specify an insert action, you must have the <literal>INSERT</literal>
privilege on the <replaceable class="parameter">target_table_name</replaceable>.
- If you specify an delete action, you must have the <literal>DELETE</literal>
+ If you specify a delete action, you must have the <literal>DELETE</literal>
privilege on the <replaceable class="parameter">target_table_name</replaceable>.
Privileges are tested once at statement start and are checked
whether or not particular <literal>WHEN</literal> clauses are executed.
- You will require the <literal>SELECT</literal> privilege on the
- <replaceable class="parameter">data_source</replaceable> and any column(s)
- of the <replaceable class="parameter">target_table_name</replaceable>
- referred to in a <literal>condition</literal>.
+ You will require the <literal>SELECT</literal> privilege on any column(s)
+ of the <replaceable class="parameter">data_source</replaceable> and
+ <replaceable class="parameter">target_table_name</replaceable> referred to
+ in any <literal>condition</literal> or <literal>expression</literal>.
</para>
<para>