writing own cast

From: Moritz Sinn <moritz(at)freesources(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: writing own cast
Date: 2002-08-15 18:26:46
Message-ID: m3bs84j7vd.fsf@moritz.sinnhq.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

--

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-08-15 19:32:28 Re: Seq scan
Previous Message Larry Rosenman 2002-08-15 18:16:43 Re: logs of postgresql and pid-stamping. possible