Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5HFI-00Cj6w-AT for pgsql-docs@arkaria.postgresql.org; Tue, 21 Nov 2023 03:16:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r5HFF-00CUEh-QL for pgsql-docs@arkaria.postgresql.org; Tue, 21 Nov 2023 03:16:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5HFF-00CUEZ-IU for pgsql-docs@lists.postgresql.org; Tue, 21 Nov 2023 03:16:13 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5HF8-007XFQ-Gn for pgsql-docs@lists.postgresql.org; Tue, 21 Nov 2023 03:16:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=ifU5hiSA+hMom7C3u8Z34rIIJeF6Dcqsq3W7TGcdQpI=; b=T7YsWA175w7oIsHdCn2dAnDywF +LXNvqbtcGPbgvYKfvhrKtTZZa/YhHeE8eKr47d6JnYF6ChdvHoWkKBISuxZucdkxx7s9reoE40sS +Av6rXBB37/G3+4r4X8VAI1OxvrM5T/0BcrunbEo2t7kShbW9X0/5GkdFvYR5I6Du0g16iYcsjtkF 4lSYd2m2en68T8Ggk8P7Yxuj4SSaKUDWdjJMzHuiYZ3UxnGDXPB/AMIMO3bn8DeBNLl6kQDQxUdCf Fj0nSrgG6V/yYWdm5/ZPPvkdGMBpQqMpZMoM2YRLcky4jNL7szgACTfl2VmbP9p+exesUP/LPMYT7 1BmDLwsQ==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1r5HF6-004EPX-1t; Mon, 20 Nov 2023 22:16:04 -0500 Date: Mon, 20 Nov 2023 22:16:04 -0500 From: Bruce Momjian To: "David G. Johnston" Cc: pgsql-docs@lists.postgresql.org Subject: Re: SELECT ... FOR UPDATE OF clause documentation implies use of table_names rather than aliases Message-ID: References: <152483686904.19805.3369061025704720797@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cebztfISR7gw+QYH" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cebztfISR7gw+QYH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --cebztfISR7gw+QYH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="alias.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 ( expressioncount | ALL } ] [ OFFSET start [ ROW | ROWS ] ] [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } ] - [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ] + [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF from_reference [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ] where from_item can be one of: @@ -1577,7 +1577,7 @@ FETCH { FIRST | NEXT } [ count ] { The locking clause has the general form -FOR lock_strength [ OF table_name [, ...] ] [ NOWAIT | SKIP LOCKED ] +FOR lock_strength [ OF from_reference [, ...] ] [ NOWAIT | SKIP LOCKED ] where lock_strength can be one of @@ -1591,8 +1591,11 @@ KEY SHARE - For more information on each row-level lock mode, refer to - . + from_reference must be a + table alias or non-hidden + table_name referenced + in the FROM clause. For more information on each + row-level lock mode, refer to . --cebztfISR7gw+QYH--