On Tue, Dec 11, 2001 at 09:26:31AM -0500, Robert B. Easter wrote:
> Anyhow, you are returning a T in your functions, so all you will get out of
> them is a number of type ::T which you will not be able to do anything with
> except select it. Trying to access the members of a T using dot won't work.
> The number cannot even be cast to an oid or any other data type (the cast
> functions don't even understand how to do anything with table types).
Thank you for your answer. I learnt a lot from it. But in one main
point it seems as if you're wrong. Look:
=>CREATE FUNCTION testfun() RETURNS T AS '
'>SELECT 13::int8 as id, ''your name''::text as name;' LANGUAGE sql;
This works, hence I can do something with a number of type ::T :
=>select name( testfun() );
But this does not work, hence I cannot do anything with a number of type ::T :
=>select name(r.a) from (select testfun() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed
What's the difference between those both cases ?
--
Holger Krug
hkrug@rationalizer.com