Search Postgresql Archives

Casting text to reg*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I needed to do $SUBJECT in 8.2, which doesn't have the built-in casts. In case anyone else needs to, the following works:

decibel@xxxxxxxxxxxxx=# create function regprocedure(text) returns regprocedure language sql as 'select regprocedurein(textout($1))';
CREATE FUNCTION
decibel@xxxxxxxxxxxxx=# create cast(text as regprocedure) with function regprocedure(text) as assignment;
CREATE CAST
decibel@xxxxxxxxxxxxx=# select 'abs(int)'::text::regprocedure;
 regprocedure
--------------
 abs(integer)
(1 row)

decibel@xxxxxxxxxxxxx=# select 'abs(int)'::text::regprocedure::oid;
 oid
------
 1397
(1 row)
--
Decibel! jnasby@xxxxxxxxxxxxxx (512) 569-9461




--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux