writing own cast

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

i wrote my own hexadecimal datatype for postgresql. the input function
expects a char* and stores the data as an integer.
so i can do something like "SELECT 'ff'::hex;" to turn a string into my
datatype.
but i would like do be able doing the same with integers:
SELECT 255::hex;
... and then getting 'ff'.

do you know how i can realize that?
i already wrote a function 'to_hex' (int->hex) and 'to_int' (hex->int).

thanks,
 moritz

--


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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: logs of postgresql and pid-stamping. possible
Следующее
От: Diogo Biazus
Дата:
Сообщение: Seq scan