From: | Nasby Jim <jnasby(at)cashnetusa(dot)com> |
---|---|
To: | General List <pgsql-general(at)postgresql(dot)org> |
Subject: | Casting text to reg* |
Date: | 2009-02-11 22:51:16 |
Message-ID: | 84B961AC-077A-41D4-B9A1-D2CEC657BFE5@cashnetusa.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)platter(dot)local=# create function regprocedure(text) returns
regprocedure language sql as 'select regprocedurein(textout($1))';
CREATE FUNCTION
decibel(at)platter(dot)local=# create cast(text as regprocedure) with
function regprocedure(text) as assignment;
CREATE CAST
decibel(at)platter(dot)local=# select 'abs(int)'::text::regprocedure;
regprocedure
--------------
abs(integer)
(1 row)
decibel(at)platter(dot)local=# select 'abs(int)'::text::regprocedure::oid;
oid
------
1397
(1 row)
--
Decibel! jnasby(at)cashnetusa(dot)com (512) 569-9461
From | Date | Subject | |
---|---|---|---|
Next Message | Igor Katson | 2009-02-11 23:17:03 | Re: Two-phase commmit, plpgsql and plproxy |
Previous Message | Inigo Barandiaran | 2009-02-11 22:24:13 | Re: createdb.exe and psql.exe without Promting Password |