From: Bruce Momjian Date: Sat, 8 Mar 2014 01:56:00 +0000 (-0500) Subject: docs: improve TABLE command by showing supported clauses X-Git-Tag: REL9_4_BETA1~364 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0cb40f93a85fd15e930828d9336e9f999ca3224;p=postgresql docs: improve TABLE command by showing supported clauses Initial patch by Colin 't Hart --- diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 7395754662..f1bc158d03 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -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 SELECT, VALUES, + Each subquery can be a SELECT, TABLE, VALUES, INSERT, UPDATE 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.