Re: Bug or stupidity

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Bug or stupidity
Дата
Msg-id 20041023144154.GB21471@svana.org
обсуждение исходный текст
Ответ на Re: Bug or stupidity  (Philip Hofstetter <phofstetter@sensational.ch>)
Список 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@svana.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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Eddy Macnaghten
Дата:
Сообщение: Re: OID's
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Bug or stupidity