Joseph Shraibman <[EMAIL PROTECTED]> writes:
>  From the postgres docs:

>       A sub-SELECT can appear in the FROM clause. This acts as though its output 
>were 
> created as a temporary table for the duration of this single SELECT command. Note 
>that the 
> sub-SELECT must be surrounded by parentheses, and an alias must  be provided for it.

> So does postgres actually use a temporary table behind the scenses?

No.

The point of that part of the docs is that the sub-SELECT's result is
(logically) computed independently of the query that it appears in ---
thus, you can't have references to tables that aren't part of that
sub-SELECT.  This is a lot different from subselects in WHERE, the
select target list, etc, since they can depend on their context.

If you can think of a clearer way of phrasing the docs, let's have it.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to