doc: clarify that "excluded" ON CONFLICT is a single row

Original patch by David G. Johnston.

Reported-by: David G. Johnston

Discussion: https://postgr.es/m/CAKFQuwa4J0+WuO7kW1PLbjoEvzPN+Q_j+P2bXxNnCLaszY7ZdQ@mail.gmail.com

Backpatch-through: 10
This commit is contained in:
Bruce Momjian 2022-07-14 15:33:28 -04:00
parent 6959e971b3
commit 4f63f6aae0
1 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ INSERT INTO <replaceable class="parameter">table_name</replaceable> [ AS <replac
provided, it completely hides the actual name of the table. provided, it completely hides the actual name of the table.
This is particularly useful when <literal>ON CONFLICT DO UPDATE</literal> This is particularly useful when <literal>ON CONFLICT DO UPDATE</literal>
targets a table named <varname>excluded</varname>, since that will otherwise targets a table named <varname>excluded</varname>, since that will otherwise
be taken as the name of the special table representing rows proposed be taken as the name of the special table representing the row proposed
for insertion. for insertion.
</para> </para>
</listitem> </listitem>
@ -401,7 +401,7 @@ INSERT INTO <replaceable class="parameter">table_name</replaceable> [ AS <replac
conflict. The <literal>SET</literal> and conflict. The <literal>SET</literal> and
<literal>WHERE</literal> clauses in <literal>ON CONFLICT DO <literal>WHERE</literal> clauses in <literal>ON CONFLICT DO
UPDATE</literal> have access to the existing row using the UPDATE</literal> have access to the existing row using the
table's name (or an alias), and to rows proposed for insertion table's name (or an alias), and to the row proposed for insertion
using the special <varname>excluded</varname> table. using the special <varname>excluded</varname> table.
<literal>SELECT</literal> privilege is required on any column in the <literal>SELECT</literal> privilege is required on any column in the
target table where corresponding <varname>excluded</varname> target table where corresponding <varname>excluded</varname>