pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: SELECT ... FOR UPDATE OF clause documentation implies use of table_names rather than aliases
Date: Mon, 20 Nov 2023 22:16:04 -0500
Message-ID: <ZVwg9AP4Zvj3RR1J@momjian.us> (raw)
In-Reply-To: <CAKFQuwb=PnpzD=k7wWyWNdE2NnExw0kLpYcpOOC4P_EHdC8Wtw@mail.gmail.com>
References: <152483686904.19805.3369061025704720797@wrigleys.postgresql.org>
	<ZVflgb-C2xAmdgBC@momjian.us>
	<CAKFQuwa9CX11j5AZSp0Hk16wwW7474hhWHsCEGg1-dMsa4Mg+g@mail.gmail.com>
	<ZVwQHCA85qhKPUcG@momjian.us>
	<CAKFQuwb=PnpzD=k7wWyWNdE2NnExw0kLpYcpOOC4P_EHdC8Wtw@mail.gmail.com>

On Mon, Nov 20, 2023 at 07:19:39PM -0700, David G. Johnston wrote:
> The placement in the numbered listing section feels wrong, I am OK with
> the wording.  It should be down in the clause details.
> 
> FOR lock_strength [ OF from_reference [, ...] ] [ NOWAIT | SKIP LOCKED ]  --
> need to change this spot to match
> 
> where lock_strength can be one of
> 
> [...]
> 
> + and from_reference must be a table alias or non-hidden table_name referenced
> in the FROM clause.
> 
> For more information on each [...]

Ah, good point.  I was searching for "FOR UPDATE" so I missed that
section;  updated patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachments:

  [text/x-diff] alias.diff (2.0K, ../ZVwg9AP4Zvj3RR1J@momjian.us/2-alias.diff)
  download | inline diff:
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 227ba1993b..9917df7839 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -45,7 +45,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
     [ LIMIT { <replaceable class="parameter">count</replaceable> | ALL } ]
     [ OFFSET <replaceable class="parameter">start</replaceable> [ ROW | ROWS ] ]
     [ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] { ROW | ROWS } { ONLY | WITH TIES } ]
-    [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ]
+    [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF <replaceable class="parameter">from_reference</replaceable> [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ]
 
 <phrase>where <replaceable class="parameter">from_item</replaceable> can be one of:</phrase>
 
@@ -1577,7 +1577,7 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] {
     The locking clause has the general form
 
 <synopsis>
-FOR <replaceable>lock_strength</replaceable> [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT | SKIP LOCKED ]
+FOR <replaceable>lock_strength</replaceable> [ OF <replaceable class="parameter">from_reference</replaceable> [, ...] ] [ NOWAIT | SKIP LOCKED ]
 </synopsis>
 
     where <replaceable>lock_strength</replaceable> can be one of
@@ -1591,8 +1591,11 @@ KEY SHARE
    </para>
 
    <para>
-    For more information on each row-level lock mode, refer to
-    <xref linkend="locking-rows"/>.
+    <replaceable class="parameter">from_reference</replaceable> must be a
+    table <replaceable class="parameter">alias</replaceable> or non-hidden
+    <replaceable class="parameter">table_name</replaceable> referenced
+    in the <literal>FROM</literal> clause.  For more information on each
+    row-level lock mode, refer to <xref linkend="locking-rows"/>.
    </para>
 
    <para>

view thread (8+ messages)  latest in thread

Message-ID: <ZVwg9AP4Zvj3RR1J@momjian.us>
Permalink:  ../ZVwg9AP4Zvj3RR1J@momjian.us/
Also on:    postgresql.org/message-id/ZVwg9AP4Zvj3RR1J@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, david.g.johnston@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: SELECT ... FOR UPDATE OF clause documentation implies use of table_names rather than aliases
  In-Reply-To: <ZVwg9AP4Zvj3RR1J@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox