Re: TABLE not synonymous with SELECT * FROM? - Mailing list pgsql-hackers

From David Johnston
Subject Re: TABLE not synonymous with SELECT * FROM?
Date
Msg-id 1384184585646-5777733.post@n5.nabble.com
Whole thread Raw
In response to Re: TABLE not synonymous with SELECT * FROM?  ("Colin 't Hart" <colinthart@gmail.com>)
Responses Re: TABLE not synonymous with SELECT * FROM?  (cthart <colinthart@gmail.com>)
List pgsql-hackers
Colin 't Hart wrote
> Methinks we should fix the documentation, something like:
> 
> The command
> 
> TABLE name
> 
> 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. Only the WITH, ORDER BY, LIMIT,
> and Locking clauses and set operations can be used with TABLE; the
> WHERE and ORDER BY clauses and any form of aggregation cannot be used.

The paragraph is unnecessary if the Synopsis section of the SELECT
documentation is updated to correctly reflect all the valid clauses that can
be attached to TABLE.  The current reading implies that you cannot attach
anything so when you said LIMIT worked I was surprised.

Also, testing seems to confirm that the allowance of LIMIT implies that
OFFSET is allowed as well.

If TABLE is allowed as a top-level command why doesn't it get its own page
in the SQL commands section?  It really doesn't matter - and honestly while
I've known about it I've never actually thought to use it in actual queries
because as soon as you want to do something special you have to switch it
out for SELECT * FROM anyway - but it does seem inconsistent.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/TABLE-not-synonymous-with-SELECT-FROM-tp5777695p5777733.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Another bug(?) turned up by the llvm optimization checker
Next
From: Andres Freund
Date:
Subject: Add %z support to elog/ereport?