Re: [Review] Tests citext casts by David Wheeler. - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: [Review] Tests citext casts by David Wheeler.
Date
Msg-id F493CAA7-8D82-45B6-9C9B-925639920644@kineticode.com
Whole thread Raw
In response to Re: [Review] Tests citext casts by David Wheeler.  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: [Review] Tests citext casts by David Wheeler.  ("David E. Wheeler" <david@kineticode.com>)
Re: [Review] Tests citext casts by David Wheeler.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sep 12, 2008, at 11:06, David E. Wheeler wrote:

>> Er, look into pg_cast and then pg_proc?  For instance
>>
>> select oid::regprocedure, prosrc from pg_proc
>> where oid in (select castfunc from pg_cast);
>
> That looks like *exactly* what I need. Thanks!

Pity. Looks like there were only a few I wasn't using, text_char,  
char_text, text_name, and texttoxml. Do I really need to keep all my  
other casts like these in 8.3?

CREATE OR REPLACE FUNCTION int8(citext)
RETURNS int8
AS 'SELECT int8( $1::text )'
LANGUAGE SQL IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION citext(int8)
RETURNS citext
AS 'SELECT text( $1 )::citext'
LANGUAGE SQL IMMUTABLE STRICT;

Thanks,

David


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: [Review] Tests citext casts by David Wheeler.
Next
From: "David E. Wheeler"
Date:
Subject: Re: [Review] Tests citext casts by David Wheeler.