Skip site navigation (1) Skip section navigation (2)

Re: No error when FROM is missing in subquery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas H(dot)" <me(at)alternize(dot)com>
Cc: "Jaime Casanova" <systemguards(at)gmail(dot)com>, nikolay(at)samokhvalov(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: No error when FROM is missing in subquery
Date: 2006-12-19 05:19:43
Message-ID: 13478.1166505583@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Thomas H." <me(at)alternize(dot)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

In response to

pgsql-bugs by date

Next:From: mikeDate: 2006-12-19 05:40:18
Subject: Re: No error when FROM is missing in subquery
Previous:From: Tom LaneDate: 2006-12-19 05:13:01
Subject: Re: BUG #2837: i received ERROR: failed to build any 7-way joins

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group