Re: No error when FROM is missing in subquery - Mailing list pgsql-bugs

From Tom Lane
Subject Re: No error when FROM is missing in subquery
Date
Msg-id 13478.1166505583@sss.pgh.pa.us
Whole thread Raw
In response to Re: No error when FROM is missing in subquery  ("Thomas H." <me@alternize.com>)
List pgsql-bugs
"Thomas H." <me@alternize.com> writes:
> SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id WHERE
> mov_name like '%, %' LIMIT 2)

> the subselect is missing a FROM <table>. in that case, pgsql seemed to also
> ignore the LIMIT 2

It didn't "ignore" anything.  Each execution of the sub-select returned
1 row, containing the current mov_id from the outer query.  So basically
this would've selected everything passing the LIKE condition.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2837: i received ERROR: failed to build any 7-way joins
Next
From: mike
Date:
Subject: Re: No error when FROM is missing in subquery