doc: adjust UPDATE/DELETE's FROM/USING to match SELECT's FROM
authorBruce Momjian
Tue, 31 Mar 2020 20:31:44 +0000 (16:31 -0400)
committerBruce Momjian
Tue, 31 Mar 2020 20:31:44 +0000 (16:31 -0400)
Previously the syntax and wording were unclear.

Reported-by: Alexey Bashtanov
Discussion: https://postgr.es/m/968d4724-8e58-788f-7c45-f7b1813824cc@imap.cc

Backpatch-through: 9.5

doc/src/sgml/ref/delete.sgml
doc/src/sgml/ref/update.sgml

index 20417a13919b5e8fa26549ebef77aba504398a4c..8924011a5769b1baeb7742aac44c29f039a3b2d0 100644 (file)
@@ -23,7 +23,7 @@ PostgreSQL documentation
 
 [ WITH [ RECURSIVE ] with_query [, ...] ]
 DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ]
-    [ USING PARAMETER">using_list ]
+    [ USING parameter">from_item [, ...] ]
     [ WHERE condition | WHERE CURRENT OF cursor_name ]
     [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
 
@@ -117,17 +117,17 @@ DELETE FROM [ ONLY ] table_name [ *
    
 
    
-    PARAMETER">using_list
+    parameter">from_item
     
      
-      A list of table expressions, allowing columns from other tables
-      to appear in the WHERE condition.  This is similar
-      to the list of tables that can be specified in the 
-      linkend="sql-from" endterm="sql-from-title"> of a
-      SELECT statement; for example, an alias for
-      the table name can be specified.  Do not repeat the target table
-      in the using_list,
-      unless you wish to set up a self-join.
+      A table expression allowing columns from other tables to appear
+      in the WHERE condition.  This uses the same
+      syntax as the 
+      of a SELECT statement; for example, an alias
+      for the table name can be specified.  Do not repeat the target
+      table as a from_item
+      unless you wish to set up a self-join (in which case it must appear
+      with an alias in the from_item).
      
     
    
index 8a1619fb68b60d2f6d3df10928d87324a2044320..512310a726040d9bec036cb72f7999ea8138018c 100644 (file)
@@ -27,7 +27,7 @@ UPDATE [ ONLY ] table_name [ * ] [
           ( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [, ...] ) |
           ( column_name [, ...] ) = ( sub-SELECT )
         } [, ...]
-    [ FROM PARAMETER">from_list ]
+    [ FROM parameter">from_item [, ...] ]
     [ WHERE condition | WHERE CURRENT OF cursor_name ]
     [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
 
@@ -164,17 +164,17 @@ UPDATE [ ONLY ] table_name [ * ] [
    
 
    
-    PARAMETER">from_list
+    parameter">from_item
     
      
-      A list of table expressions, allowing columns from other tables
-      to appear in the WHERE condition and the update
-      expressions. This is similar to the list of tables that can be
-      specified in the 
-      endterm="sql-from-title"> of a SELECT
-      statement.  Note that the target table must not appear in the
-      from_list, unless you intend a self-join (in which
-      case it must appear with an alias in the from_list>).
+      A table expression allowing columns from other tables to appear in
+      the WHERE condition and update expressions. This
+      uses the same syntax as the 
+      endterm="sql-from-title"> of a SELECT statement;
+      for example, an alias for the table name can be specified.  Do not
+      repeat the target table as a from_item
+      unless you intend a self-join (in which case it must appear with
+      an alias in the from_item>).
      
     
    
@@ -264,7 +264,7 @@ UPDATE count
   
    When a FROM clause is present, what essentially happens
    is that the target table is joined to the tables mentioned in the
-   from_list, and each output row of the join
+   from_item list, and each output row of the join
    represents an update operation for the target table.  When using
    FROM you should ensure that the join
    produces at most one output row for each row to be modified.  In