Re: writing own cast

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: writing own cast
Дата
Msg-id 7232.1029506218@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: writing own cast  (Moritz Sinn <moritz@freesources.org>)
Список pgsql-general
Moritz Sinn <moritz@freesources.org> writes:
> but i've to type 255::int::hex, because when i type 255::hex it first
> casts the int to an string and then to hex, so it returns 255 instead of
> ff.

I think this means that you need to rethink your I/O definitions for the
datatype.  255::hex is not really different from '255'::hex, and should
not be because the type of the literal constant is as yet unassigned.
The operation invoked is your type's input routine, and nothing else.
An operation like integercolumn::hex is a completely different thing.

            regards, tom lane

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

Предыдущее
От: Elielson Fontanezi
Дата:
Сообщение: DAO for PostGRE
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Triggers