Re: varchar, text and cidr - Mailing list pgsql-general

From Richard Welty
Subject Re: varchar, text and cidr
Date
Msg-id E19jqVx-0002y0-NT@skipper.averillpark.net
Whole thread Raw
In response to Re: varchar, text and cidr  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, 04 Aug 2003 20:07:18 -0400 Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Richard Welty <rwelty@averillpark.net> writes:
> > On Mon, 04 Aug 2003 18:07:49 -0400 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> 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( varchar);
> > ERROR:  CreateCast: function cidr(character varying) does not exist
>
> Yeah, you'd need to create a pg_proc entry for cidr(varchar) --- though
> you can get away with letting it point to the implementation function
> for cidr(text).

which would be a new row looking like this one, but with a different entry
in the vector of arg types. at this point, i end up needing to know the
OIDs for the argument types to do this after all. i guess i can figure that
out from looking at other functions in the pg_proc table.

test=# select * from pg_proc where proname = 'cidr';
 proname | pronamespace | proowner | prolang | proisagg | prosecdef
---------+--------------+----------+---------+----------+----------
 cidr    |           11 |        1 |      12 | f        | f

 | proisstrict | proretset | provolatile | pronargs | prorettype |
-+-------------+-----------+-------------+----------+------------+
 | t           | f         | i           |        1 |        650 |

 proargtypes |  prosrc   | probin | proacl
-------------+-----------+--------+--------
          25 | text_cidr | -      | {=X}
(1 row)

test=#

--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security

pgsql-general by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: like performance w/o wildcards.
Next
From: Craig Thomas
Date:
Subject: Re: [osdldbt-general] Re: [PERFORM] OSDL Database Test Suite 3 is