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

From Jaime Casanova
Subject Re: No error when FROM is missing in subquery
Date
Msg-id c2d9e70e0612181943l2a8b2e15qea80ce912984f3bd@mail.gmail.com
Whole thread Raw
In response to Re: No error when FROM is missing in subquery  ("Thomas H." <me@alternize.com>)
List pgsql-bugs
On 12/18/06, Thomas H. <me@alternize.com> wrote:
> >> > Is it a bug? If no, maybe to produce warning in such cases?
>
> oups. just thumbled over this as well when i forgot a FROM in a WHERE ... IN
> (....) and damaged quite some data. the bad query went like this:
>
> 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 and returned 3706 records out of ~130000...

and the UPDATE was?

also the limit applies only to the subselect, it has nothing to do
with the upper query so the upper query can return more than number of
rows specified in the subselect...

> no clue which ones :-/
>

LIMIT is often meaningfull only in conjuction with ORDER BY

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

pgsql-bugs by date:

Previous
From: "Thomas H."
Date:
Subject: Re: No error when FROM is missing in subquery
Next
From: "Thomas H."
Date:
Subject: Re: No error when FROM is missing in subquery