Re: No error when column doesn't exist

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: No error when column doesn't exist
Дата
Msg-id 15859.1221132273@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: No error when column doesn't exist  (Dean Rasheed <dean_rasheed@hotmail.com>)
Ответы Re: No error when column doesn't exist  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
Dean Rasheed <dean_rasheed@hotmail.com> writes:
>> foo.char and foo.varchar have similarly unexpected behavior; I think
>> that's probably the end of it, though, since those are the only types
>> that CoerceViaIO will take as targets.

> ... and also any user defined domains based on those, which is
> what I actually had.

Ouch.  That makes the scope for unexpected behavior wider than I thought.
Maybe we do need some restriction here?

The ideas I had involved not considering the cast interpretation when
the actual syntax is table.column and some-set-of-other-conditions.
While this is certainly possible to implement, any variant of it will
break the existing 100% equivalence of foo.bar and bar(foo); which
seems to me to be a nice principle, though I grant you won't find it
anywhere in the SQL standard.

The other-conditions are a bit up for grabs.  The narrowest restriction
that would serve the purpose is "table variable is of composite type
and the cast would be a CoerceViaIO cast", but that definitely seems
like a wart.  However, cleaner-seeming restrictions like "no casts on
composites at all" could potentially break applications that worked
okay before 8.3.

Comments anyone?  Should we try to change this, or leave well enough
alone?

            regards, tom lane

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

Предыдущее
От: Harald Fuchs
Дата:
Сообщение: Re: psql scripting tutorials
Следующее
От: Joao Ferreira gmail
Дата:
Сообщение: about partitioning