docs: improve TABLE command by showing supported clauses
authorBruce Momjian
Sat, 8 Mar 2014 01:56:00 +0000 (20:56 -0500)
committerBruce Momjian
Sat, 8 Mar 2014 01:56:16 +0000 (20:56 -0500)
Initial patch by Colin 't Hart

doc/src/sgml/ref/select.sgml

index 7395754662710b2055fa44ae6665d2c7e1a0bd03..f1bc158d03bbd45654c165051856abe1e0089c92 100644 (file)
@@ -214,7 +214,7 @@ TABLE [ ONLY ] table_name [ * ]
     subqueries that can be referenced by name in the primary query.
     The subqueries effectively act as temporary tables or views
     for the duration of the primary query.
-    Each subquery can be a SELECTVALUES,
+    Each subquery can be a SELECTTABLE, VALUES,
     INSERTUPDATE or
     DELETE statement.
     When writing a data-modifying statement (INSERT,
@@ -1489,12 +1489,17 @@ SELECT * FROM (SELECT * FROM mytable FOR UPDATE) ss ORDER BY column1;
 
 TABLE name
 
-    is completely equivalent to
+    is equivalent to
 
 SELECT * FROM name
 
     It can be used as a top-level command or as a space-saving syntax
-    variant in parts of complex queries.
+    variant in parts of complex queries. Only the WITH,
+    UNION, INTERSECT, EXCEPT,
+    ORDER BY, LIMIT, OFFSET,
+    FETCH and locking clauses can be used with TABLE;
+    the WHERE clause and any form of aggregation cannot
+    be used.