Casting text to reg* - Mailing list pgsql-general

From Nasby Jim
Subject Casting text to reg*
Date
Msg-id 84B961AC-077A-41D4-B9A1-D2CEC657BFE5@cashnetusa.com
Whole thread Raw
List 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@platter.local=# create function regprocedure(text) returns
regprocedure language sql as 'select regprocedurein(textout($1))';
CREATE FUNCTION
decibel@platter.local=# create cast(text as regprocedure) with
function regprocedure(text) as assignment;
CREATE CAST
decibel@platter.local=# select 'abs(int)'::text::regprocedure;
  regprocedure
--------------
  abs(integer)
(1 row)

decibel@platter.local=# select 'abs(int)'::text::regprocedure::oid;
  oid
------
  1397
(1 row)
--
Decibel! jnasby@cashnetusa.com (512) 569-9461




pgsql-general by date:

Previous
From: Inigo Barandiaran
Date:
Subject: Re: createdb.exe and psql.exe without Promting Password
Next
From: Igor Katson
Date:
Subject: Re: Two-phase commmit, plpgsql and plproxy