Re: bug or my ignorance ? - Mailing list pgsql-general

From Holger Krug
Subject Re: bug or my ignorance ?
Date
Msg-id 20011211155150.A13501@dev12.rationalizer.com
Whole thread Raw
In response to Re: bug or my ignorance ?  ("Robert B. Easter" <reaster@comptechnews.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: wsheldah@lexmark.com
Date:
Subject: Re: Need SQL help, I'm stuck.
Next
From: Tom Lane
Date:
Subject: Re: Problem with indexes