Re: writing own cast

Поиск
Список
Период
Сортировка
От Moritz Sinn
Тема Re: writing own cast
Дата
Msg-id m3fzxf56vt.fsf@moritz.sinnhq.de
обсуждение исходный текст
Ответ на Re: writing own cast  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: writing own cast  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Sure, make a function hex(int) returning hex.  The function name
> must match the datatype name.

thanks, now it works!
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.
well, that doesn't matter much, but it interests me if this problem
could be solved too. i think the reason is that the input function of my
hexadecimal datatype expects an string, and so the int is turned into an
string and then passed to this input function.

regards,
 moritz

--
Try to remove the color-problem by restarting your computer several times.
    -- Microsoft Internet Explorer README.TXT

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

Предыдущее
От: Justin Clift
Дата:
Сообщение: Finally, a list of *big* companies using PostgreSQL for *serious* projects. Why use PostgreSQL? Here's why.
Следующее
От: Sean Chittenden
Дата:
Сообщение: Re: [HACKERS] Finally, a list of *big* companies using PostgreSQL for *serious* projects. Why use PostgreSQL? Here's why.