bug or my ignorance ?

From: Holger Krug <hkrug(at)rationalizer(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: bug or my ignorance ?
Date: 2001-12-11 13:20:03
Message-ID: 20011211142003.A13247@dev12.rationalizer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The versions of PostgreSQL I used:
* CVS of Dec. 11, virgin installation without any further changes
* 7.1.3

I have simple SQL functions `testfun()' and `testfun1()' returning values
of the type of relation `T':

=>CREATE TABLE T ( id int8, name text );

=>insert into T VALUES ( 15, 'my name' );

=>CREATE FUNCTION testfun() RETURNS T AS '
'>SELECT 13::int8 as id, ''your name''::text as name;' LANGUAGE sql;

-- or: 'sql' for PostgreSQL 7.1.3

=>CREATE FUNCTION testfun1() RETURNS T AS '
'>SELECT id, name from T;' LANGUAGE sql;

-- or: 'sql' for PostgreSQL 7.1.3

Now I try to call the first function and return the values to the user:

=>select name(r.a) from (select testfun() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed

Does not work. For the second function I first try a simpler call:

=> select r.a from (select testfun1() as a) as r;
a
-----------
137835800
(1 Zeile)

Works but does not help. Retrying it gives two alternating return values:

=> select r.a from (select testfun1() as a) as r;
a
-----------
137857448
(1 Zeile)

=> select r.a from (select testfun1() as a) as r;
a
-----------
137835800
(1 Zeile)

=> select r.a from (select testfun1() as a) as r;
a
-----------
137857448
(1 Zeile)

Now lets look if can return the result of the second function to the
user:

=>select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137835928: cache lookup failed
=> select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed
=>select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137835928: cache lookup failed
=> select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed
=>select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137835928: cache lookup failed
=> select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed
=>select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137835928: cache lookup failed
=> select name(r.a) from (select testfun1() as a) as r;
ERROR: fmgr_info: function 137857576: cache lookup failed

Unfortunately I cannot.

Is this a sign of insufficient experience from my side or a real bug ?

--
Holger Krug
hkrug(at)rationalizer(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Colm McCartan 2001-12-11 13:32:47 Re: RedHat6.2 - postgres 7.1.2 lib confusion
Previous Message Przemyslaw Kowalczyk 2001-12-11 11:40:40 Problem with indexes