Re: Bug or stupidity

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Philip Hofstetter <phofstetter(at)sensational(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug or stupidity
Date: 2004-10-23 14:41:57
Message-ID: 20041023144154.GB21471@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Oct 23, 2004 at 02:35:20PM +0000, Philip Hofstetter wrote:
> >As for what's SQL standard, I think by a strict definition your query
> >shouldn't be allowed at all, referencing an undefined table.
>
> This is exactly what I think too. I mean: I know I made an error in my
> query. It would just have been easier to find if PostgreSQL actually had
> told me so (I'm not getting those NOTICEs from PHP...).
>
> If it's wrong, it should be disallowed, not made worse by assuming a
> completely wrong thing.

Maybe, ofcourse, this exact same construct is used heavily in DELETEs.
Look at the syntax of the delete command:

DELETE FROM [ ONLY ] table [ WHERE condition ]

You can't declare extra tables or define aliases. Every other table
used in the query is by strict definitions "undefined". Should they all
be declared illegal too?

Perhaps you could argue that using undeclared tables is allowed for
DELETEs but not for SELECTs. But why make a distiction if you don't
need to.

Hope this helps,

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eddy Macnaghten 2004-10-23 14:42:20 Re: OID's
Previous Message Philip Hofstetter 2004-10-23 14:35:20 Re: Bug or stupidity