Re: "ERROR: operator is not unique" with Custom Data Type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "ERROR: operator is not unique" with Custom Data Type
Дата
Msg-id 23841.1212691889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "ERROR: operator is not unique" with Custom Data Type  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: "ERROR: operator is not unique" with Custom Data Type
Список pgsql-hackers
"David E. Wheeler" <david@kineticode.com> writes:
> On Jun 5, 2008, at 11:28, Martijn van Oosterhout wrote:
>> What would you want postgresql to choose in this case.

> I was thinking that the ::text should be cast to ::lctext, as that's  
> how `'a'::lctext = 'a'` works, but I keep going back and forth in my  
> mind. Maybe 'a'::lctext should not equal 'A'::text.

It seems to me that lctext is sort of like a more-constrained version
of text (like a domain), which suggests that the lctext -> text
direction can be implicit but the other direction should not be.

Moreover, if you don't have lctext -> text be implicit then you
will find that none of the non-comparison text functions work on
lctext except with a cast; which is not the place you want to be.

I concur with Martijn that having both directions implicit is a
Bad Idea.

BTW, I would encourage you to think of this project as citext version 2,
rather than inventing a new name for the datatype.  All you'll
accomplish with that is make it hard for users of citext to transition.
        regards, tom lane


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

Предыдущее
От: Robert Lor
Дата:
Сообщение: Re: Overhauling GUCS
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: "ERROR: operator is not unique" with Custom Data Type