I just can't get it:record_in, record_out(I know i try to do something postgres is not developed for but there are many 'buts')

From: "Peter Filipov" <pfilipov(at)netissat(dot)bg>
To: pgsql-general(at)postgresql(dot)org
Subject: I just can't get it:record_in, record_out(I know i try to do something postgres is not developed for but there are many 'buts')
Date: 2005-11-04 18:08:43
Message-ID: opszp90tfvligf9v@draco
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is what i can't get right:

CREATE type tst_tst as (a integer, b text);

CREATE OR REPLACE FUNCTION tst_store(a anyelement) RETURNS text AS $$
BEGIN
RETURN textin(record_out(a));
END
$$ LANGUAGE PLPGSQL;

create or replace function tst_load1(a text) returns tst_tst as $$
declare
b tst_tst;
c text;
begin
c := record_in(textout(a), 'tst_tst'::regtype::oid, 0);
c := 'select row' || c || '::tst_tst';
raise notice 'boza:%', c;
execute c into b;
return b;
end
$$ language plpgsql;

Somebody help please

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Browse pgsql-general by date

  From Date Subject
Next Message Assad Jarrahian 2005-11-04 18:58:59 pl/pgsql list as parameter.
Previous Message Robert Ftizpatrick 2005-11-04 17:48:18 Re: Division