Re: writing own cast - Mailing list pgsql-general

From Tom Lane
Subject Re: writing own cast
Date
Msg-id 4637.1029474562@sss.pgh.pa.us
Whole thread Raw
In response to writing own cast  (Moritz Sinn <moritz@freesources.org>)
Responses Re: writing own cast  (Moritz Sinn <moritz@freesources.org>)
List pgsql-general
Moritz Sinn <moritz@freesources.org> writes:
> 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?

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

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: again: how to synchronize database operations?
Next
From: "Ben-Nes Michael"
Date:
Subject: pg_query & pg_last_oid