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

Re: No error when FROM is missing in subquery

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: nikolay(at)samokhvalov(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: No error when FROM is missing in subquery
Date: 2006-12-19 01:19:08
Message-ID: c2d9e70e0612181719u4dfc06bcwe2477898e056e541@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
> On 12/19/06, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com> wrote:
> > Following query is considered as correct, no "missing from" error has
> > been reported (so, entire table will be updated and "on update"
> > triggers will be fired for every row):
> >
> > update item set obj_id = obj_id
> > where obj_id in (select obj_id where item_point is null order by
> > obj_modified limit 10)
> >
> > Is it a bug? If no, maybe to produce warning in such cases?
>
On 12/18/06, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com> wrote:
> ok, sorry, I've realized that it's yet another example of "outer
> reference", Tom will say "read any SQL book" again :-)
>
> http://archives.postgresql.org/pgsql-bugs/2006-12/msg00115.php
>

not really... AFAIK, the FROM clause is mandatory per SQL... older
releases of postgres fill the missing from clause if it was easy to
determine, in recent releases it's mandatory unless you specify the
opposite in postgresql.conf with the add_missing_from parameter

-- 
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

In response to

Responses

pgsql-bugs by date

Next:From: Thomas H.Date: 2006-12-19 03:26:21
Subject: Re: No error when FROM is missing in subquery
Previous:From: Nikolay SamokhvalovDate: 2006-12-18 23:15:03
Subject: Re: No error when FROM is missing in subquery

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