From: Dean Rasheed Date: Sat, 18 Nov 2023 12:41:23 +0000 (+0000) Subject: doc: improve description of privileges for MERGE and update glossary. X-Git-Tag: REL_17_BETA1~1440 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=4bc8f29088f8a2e9c89e6c0819337c4c8bf5f20a;p=postgresql.git 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 --- diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml index fe8def41d04..5815fa44710 100644 --- a/doc/src/sgml/glossary.sgml +++ b/doc/src/sgml/glossary.sgml @@ -1097,8 +1097,8 @@ (just like a view), but stores data in the same way that a table does. It cannot be - modified via INSERT, UPDATE, or - DELETE operations. + modified via INSERT, UPDATE, + DELETE, or MERGE operations. For more information, see @@ -1107,6 +1107,23 @@ + + Merge + + + An SQL command used to conditionally add, modify, + or remove rows + in a given table, + using data from a source + relation. + + + For more information, see + . + + + + Multi-version concurrency control (MVCC) diff --git a/doc/src/sgml/ref/merge.sgml b/doc/src/sgml/ref/merge.sgml index 0f61d472cd8..d5ad930eef2 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 SET clause. If you specify an insert action, you must have the INSERT privilege on the target_table_name. - If you specify an delete action, you must have the DELETE + If you specify a delete action, you must have the DELETE privilege on the target_table_name. Privileges are tested once at statement start and are checked whether or not particular WHEN clauses are executed. - You will require the SELECT privilege on the - data_source and any column(s) - of the target_table_name - referred to in a condition. + You will require the SELECT privilege on any column(s) + of the data_source and + target_table_name referred to + in any condition or expression.