On Mon, 04 Aug 2003 18:07:49 -0400 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Richard Welty <rwelty@averillpark.net> writes:
> > On Mon, 04 Aug 2003 16:58:29 -0400 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Lack of an entry in pg_cast for varchar->cidr. Feel free to create
> one.
> > if i knew how to determine the oid for a data type, i certainly would.
> You don't have to. See CREATE CAST.
cool. although it does look like there's still a piece missing:
test=# create cast( varchar as cidr) with function cidr( text);
ERROR: argument of cast function must match source data type
test=# create cast( varchar as cidr) with function cidr( varchar);
ERROR: CreateCast: function cidr(character varying) does not exist
which i find interesting, since i can use the cidr funtion directly on
the varchar field:
test=# select * from vctest where '192.0.2.5'::cidr << cidr( baz);
baz
--------------
192.0.2.0/24
(1 row)
note that i'm not in any big rush to deal with this, the cast-of-a-cast is
working ok at my customer's site.
oh well,
richard
--
Richard Welty rwelty@averillpark.net
Averill Park Networking 518-573-7592
Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security