Re: Ok, how do I debug THIS? - Mailing list pgsql-sql

From Larry Rosenman
Subject Re: Ok, how do I debug THIS?
Date
Msg-id 312680000.1052857873@lerlaptop.iadfw.net
Whole thread Raw
In response to Re: Ok, how do I debug THIS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Testing castability of text to numeric  (Randall Lucas <rlucas@tercent.net>)
List pgsql-sql

--On Tuesday, May 13, 2003 16:21:39 -0400 Tom Lane <tgl@sss.pgh.pa.us> 
wrote:

> Larry Rosenman <ler@lerctr.org> writes:
>>> Ugh.  cidr doesn't appear to cast to text.  You may be able to go
>>> through inet, but I'm not really sure because I haven't really used
>>> those types.
>
>> looks like I can, **BUT** is this the RIGHT thing?  I suspect it SHOULD
>> cast to text.  IMNSHO.
>
> Probably.  We have an inet->text cast, and the same function would work
> for cidr->text.  I think it's just an oversight that there's no such
> entry in pg_cast.  You could add one by hand ...
How would I do that?

Also, this is what I wound up with for that line, which seems ugly, because
it couldn't find a quote_literal(inet) without the ::text on it:
 quote_literal(NEW.netblock::inet::text) ;


Is that right?


>
>             regards, tom lane



-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Ok, how do I debug THIS?
Next
From: Randall Lucas
Date:
Subject: Testing castability of text to numeric