1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Doc: Miscellaneous doc updates for MERGE.

Update a few places in the documentation that should mention MERGE
among the list of applicable commands. In a couple of places, a
slightly more detailed description of what happens for MERGE seems
appropriate.

Reviewed by Alvaro Herrera.

Discussion: http://postgr.es/m/CAEZATCWqHLcxab89ATMQZNGFG_mxDPM%2BjzkSbXKD3JYPfRGvtw%40mail.gmail.com
This commit is contained in:
Dean Rasheed
2023-02-26 09:06:04 +00:00
parent 87f3667ec0
commit ee7e8f3838
12 changed files with 58 additions and 23 deletions

View File

@@ -306,6 +306,12 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
<command>UPDATE</command>, or it may not be published at all.
</para>
<para>
For a <command>MERGE</command> command, the publication will publish an
<command>INSERT</command>, <command>UPDATE</command>, or <command>DELETE</command>
for each row inserted, updated, or deleted.
</para>
<para>
<command>ATTACH</command>ing a table into a partition tree whose root is
published using a publication with <literal>publish_via_partition_root</literal>

View File

@@ -94,7 +94,8 @@ EXPLAIN [ ANALYZE ] [ VERBOSE ] <replaceable class="parameter">statement</replac
statement will happen as usual. If you wish to use
<command>EXPLAIN ANALYZE</command> on an
<command>INSERT</command>, <command>UPDATE</command>,
<command>DELETE</command>, <command>CREATE TABLE AS</command>,
<command>DELETE</command>, <command>MERGE</command>,
<command>CREATE TABLE AS</command>,
or <command>EXECUTE</command> statement
without letting the command affect your data, use this approach:
<programlisting>
@@ -272,7 +273,8 @@ ROLLBACK;
<listitem>
<para>
Any <command>SELECT</command>, <command>INSERT</command>, <command>UPDATE</command>,
<command>DELETE</command>, <command>VALUES</command>, <command>EXECUTE</command>,
<command>DELETE</command>, <command>MERGE</command>,
<command>VALUES</command>, <command>EXECUTE</command>,
<command>DECLARE</command>, <command>CREATE TABLE AS</command>, or
<command>CREATE MATERIALIZED VIEW AS</command> statement, whose execution
plan you wish to see.

View File

@@ -116,7 +116,8 @@ PREPARE <replaceable class="parameter">name</replaceable> [ ( <replaceable class
<listitem>
<para>
Any <command>SELECT</command>, <command>INSERT</command>, <command>UPDATE</command>,
<command>DELETE</command>, or <command>VALUES</command> statement.
<command>DELETE</command>, <command>MERGE</command>, or <command>VALUES</command>
statement.
</para>
</listitem>
</varlistentry>

View File

@@ -121,7 +121,8 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
The transaction isolation level cannot be changed after the first query or
data-modification statement (<command>SELECT</command>,
<command>INSERT</command>, <command>DELETE</command>,
<command>UPDATE</command>, <command>FETCH</command>, or
<command>UPDATE</command>, <command>MERGE</command>,
<command>FETCH</command>, or
<command>COPY</command>) of a transaction has been executed. See
<xref linkend="mvcc"/> for more information about transaction
isolation and concurrency control.
@@ -131,8 +132,9 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
The transaction access mode determines whether the transaction is
read/write or read-only. Read/write is the default. When a
transaction is read-only, the following SQL commands are
disallowed: <literal>INSERT</literal>, <literal>UPDATE</literal>,
<literal>DELETE</literal>, and <literal>COPY FROM</literal> if the
disallowed: <command>INSERT</command>, <command>UPDATE</command>,
<command>DELETE</command>, <command>MERGE</command>, and
<command>COPY FROM</command> if the
table they would write to is not a temporary table; all
<literal>CREATE</literal>, <literal>ALTER</literal>, and
<literal>DROP</literal> commands; <literal>COMMENT</literal>,
@@ -169,7 +171,8 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
start of a transaction, before the first query or
data-modification statement (<command>SELECT</command>,
<command>INSERT</command>, <command>DELETE</command>,
<command>UPDATE</command>, <command>FETCH</command>, or
<command>UPDATE</command>, <command>MERGE</command>,
<command>FETCH</command>, or
<command>COPY</command>) of the transaction. Furthermore, the transaction
must already be set to <literal>SERIALIZABLE</literal> or
<literal>REPEATABLE READ</literal> isolation level (otherwise, the snapshot