Unix Technical Forum

BUG #1702: Function returning nested composite types

This is a discussion on BUG #1702: Function returning nested composite types within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1702 Logged by: Jan Behrens Email address: jan@monso.de PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:54 AM
Jan Behrens
 
Posts: n/a
Default BUG #1702: Function returning nested composite types


The following bug has been logged online:

Bug reference: 1702
Logged by: Jan Behrens
Email address: jan@monso.de
PostgreSQL version: 8.0.3
Operating system: NetBSD
Description: Function returning nested composite types
Details:

Following input:

CREATE TYPE test1 AS (a text, b text);
CREATE TYPE test2 AS (c test1, d test1);

CREATE FUNCTION test3 () RETURNS test2
LANGUAGE 'plpgsql' AS $$
DECLARE
result test2;
BEGIN
result := ROW (ROW ('1', '2'), ROW ('3', '4'));
RETURN result;
END; $$;

SELECT * FROM test3();


generates the following error:

ERROR: row not compatible with its own tupdesc
CONTEXT: PL/pgSQL function "test3" line 5 at return


I assume this is a bug, because the source code says:

if (estate->retval == (Datum) NULL)
/* should not happen */
elog(ERROR,
"row not compatible with its own tupdesc");
[...]
if (tup == NULL) /* should not happen */
elog(ERROR,
"row not compatible with its own tupdesc");

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com