| From: | Richard Welty <rwelty(at)averillpark(dot)net> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: varchar, text and cidr | 
| Date: | 2003-08-05 01:21:25 | 
| Message-ID: | E19jqVx-0002y0-NT@skipper.averillpark.net | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On Mon, 04 Aug 2003 20:07:18 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Richard Welty <rwelty(at)averillpark(dot)net> writes:
> > On Mon, 04 Aug 2003 18:07:49 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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(at)averillpark(dot)net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security
| From | Date | Subject | |
|---|---|---|---|
| Next Message | shreedhar | 2003-08-05 05:56:03 | Fatal error: Call to undefined function: pg_connect() | 
| Previous Message | Roderick A. Anderson | 2003-08-05 00:50:56 | Re: varchar, text and cidr |