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

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: "tupdesc reference is not owned by resource owner Portal" issue in 8.2 and -HEAD
Date: 2007-01-23 16:20:32
Message-ID: 45B635D0.80105@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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();

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-01-23 16:22:59 Re: [HACKERS] Win32 WEXITSTATUS too
Previous Message Pavan Deolasee 2007-01-23 16:13:50 Re: Piggybacking vacuum I/O