Skip to content

Commit 4bc8f29

Browse files
committed
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
1 parent 823eb3d commit 4bc8f29

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

doc/src/sgml/glossary.sgml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,8 @@
10971097
(just like a <glossterm linkend="glossary-view">view</glossterm>),
10981098
but stores data in the same way that a
10991099
<glossterm linkend="glossary-table">table</glossterm> does. It cannot be
1100-
modified via <command>INSERT</command>, <command>UPDATE</command>, or
1101-
<command>DELETE</command> operations.
1100+
modified via <command>INSERT</command>, <command>UPDATE</command>,
1101+
<command>DELETE</command>, or <command>MERGE</command> operations.
11021102
</para>
11031103
<para>
11041104
For more information, see
@@ -1107,6 +1107,23 @@
11071107
</glossdef>
11081108
</glossentry>
11091109

1110+
<glossentry id="glossary-merge">
1111+
<glossterm>Merge</glossterm>
1112+
<glossdef>
1113+
<para>
1114+
An <acronym>SQL</acronym> command used to conditionally add, modify,
1115+
or remove <glossterm linkend="glossary-tuple">rows</glossterm>
1116+
in a given <glossterm linkend="glossary-table">table</glossterm>,
1117+
using data from a source
1118+
<glossterm linkend="glossary-relation">relation</glossterm>.
1119+
</para>
1120+
<para>
1121+
For more information, see
1122+
<xref linkend="sql-merge"/>.
1123+
</para>
1124+
</glossdef>
1125+
</glossentry>
1126+
11101127
<glossentry id="glossary-mvcc">
11111128
<glossterm>Multi-version concurrency control (MVCC)</glossterm>
11121129
<glossdef>

doc/src/sgml/ref/merge.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ DELETE
102102
that are referred to in the <literal>SET</literal> clause.
103103
If you specify an insert action, you must have the <literal>INSERT</literal>
104104
privilege on the <replaceable class="parameter">target_table_name</replaceable>.
105-
If you specify an delete action, you must have the <literal>DELETE</literal>
105+
If you specify a delete action, you must have the <literal>DELETE</literal>
106106
privilege on the <replaceable class="parameter">target_table_name</replaceable>.
107107
Privileges are tested once at statement start and are checked
108108
whether or not particular <literal>WHEN</literal> clauses are executed.
109-
You will require the <literal>SELECT</literal> privilege on the
110-
<replaceable class="parameter">data_source</replaceable> and any column(s)
111-
of the <replaceable class="parameter">target_table_name</replaceable>
112-
referred to in a <literal>condition</literal>.
109+
You will require the <literal>SELECT</literal> privilege on any column(s)
110+
of the <replaceable class="parameter">data_source</replaceable> and
111+
<replaceable class="parameter">target_table_name</replaceable> referred to
112+
in any <literal>condition</literal> or <literal>expression</literal>.
113113
</para>
114114

115115
<para>

0 commit comments

Comments
 (0)