Re: Casts question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Casts question
Дата
Msg-id 9978.1087764708@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Casts question  (Shachar Shemesh <psql@shemesh.biz>)
Ответы Re: Casts question  (Shachar Shemesh <psql@shemesh.biz>)
Список pgsql-hackers
Shachar Shemesh <psql@shemesh.biz> writes:
> Tom Lane wrote:
>> Yes, it can cast to varchar, but that doesn't help because there are no
>> varchar operators ;-).  To resolve the operator, it has to promote both
>> sides to text, and you didn't offer a cast to text.
>> 
> I don't get it.

When we look to see whether we can cast from type X to type Y, we look
to see whether there is a pg_cast entry from type X to type Y.  We do
not look to see if we could get there by casting X to some other type Z
and thence to Y (much less more-than-2-step sequences).  There are a
number of good reasons for this, but I'll just mention speed and
surprise factors.  Doing so would make for an exponential increase in
the number of potential cast paths, thereby probably paralyzing the
operator selection code instead of making it more useful.  (Too many
alternatives are as bad as none.)
        regards, tom lane


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

Предыдущее
От: Shachar Shemesh
Дата:
Сообщение: Re: Casts question
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Compile failure with SSL