On Mon, 04 Aug 2003 20:07:18 -0400 Tom Lane <[EMAIL PROTECTED]> wrote:
> Richard Welty <[EMAIL PROTECTED]> writes: > > On Mon, 04 Aug 2003 18:07:49 -0400 Tom Lane <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] Averill Park Networking 518-573-7592 Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend