"tupdesc reference is not owned by resource owner Portal" issue in 8.2 and -HEAD - Mailing list pgsql-hackers

From Stefan Kaltenbrunner
Subject "tupdesc reference is not owned by resource owner Portal" issue in 8.2 and -HEAD
Date
Msg-id 45B635D0.80105@kaltenbrunner.cc
Whole thread Raw
Responses Re: "tupdesc reference is not owned by resource owner Portal" issue in 8.2 and -HEAD  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The following testcase(extracted from a much much larger production code 
sample) results in

WARNING:  TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still 
referenced
CONTEXT:  PL/pgSQL function "foo" line 4 at block variables initialization
ERROR:  tupdesc reference 0xb3573b88 is not owned by resource owner Portal
CONTEXT:  PL/pgSQL function "foo" while casting return value to 
function's return type

on 8.2 and -HEAD.

8.1 seems to work fine.

Stefan


CREATE OR REPLACE FUNCTION public.foo() RETURNS INTEGER AS $$
DECLARE
v_var INTEGER;
BEGIN
BEGIN
v_var := (bar()).error_code;
EXCEPTION WHEN others THEN        RETURN 0;
END;
RETURN 0;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION public.bar(OUT error_code INTEGER, OUT new_id 
INTEGER) RETURNS RECORD AS $$
BEGIN
error_code := 1;
new_id := 1;
RETURN;
END;
$$ LANGUAGE plpgsql;

SELECT * FROM public.foo();


pgsql-hackers by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: Piggybacking vacuum I/O
Next
From: "Simon Riggs"
Date:
Subject: Re: Updateable cursors