From 5134e9d295f335b4ee9f8846f934e5593f65e881 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 7 Dec 2023 19:43:04 -0500 Subject: [PATCH] doc: FOR UPDATE / KEY / SHARE / KEY SHARE takes an table alias Previously only a table name was documented for this SELECT clause. Reported-by: robert Discussion: https://postgr.es/m/152483686904.19805.3369061025704720797@wrigleys.postgresql.org Backpatch-through: master --- doc/src/sgml/ref/select.sgml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 .