Re: BUG #5556: "cannot drop active portal" and "ERRORDATA_STACK_SIZE exceeded" lead to server crash - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #5556: "cannot drop active portal" and "ERRORDATA_STACK_SIZE exceeded" lead to server crash
Date
Msg-id 4C3C2314.10701@enterprisedb.com
Whole thread Raw
In response to Re: BUG #5556: "cannot drop active portal" and "ERRORDATA_STACK_SIZE exceeded" lead to server crash  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 13/07/10 02:22, Tom Lane wrote:
> "Robert Walker"<robwalker01@speedymail.org>  writes:
>> Description:        "cannot drop active portal" and "ERRORDATA_STACK_SIZE
>> exceeded" lead to server crash
>
> We're really going to need to see a self-contained example to do much
> with this.

I see what's going on, I neglected to change subtransaction abort
cleanup the same way I did main transaction cleanup. This is
reproducible with:

CREATE OR REPLACE FUNCTION func() RETURNS VOID AS '
   declare
     erec record;
     --cur CURSOR IS SELECT generate_series(1,10) AS a;
     BEGIN
         FOR erec IN EXECUTE ''SELECT generate_series(1,10) AS a'' LOOP
             raise notice ''row %'', erec.a ;
             IF (erec.a = 5) THEN PERFORM closefunc(); END IF;
         END LOOP;
         RETURN;
     END;
' LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION closefunc() RETURNS void AS ' CLOSE "<unnamed
portal 1>"; ' LANGUAGE sql;

begin;
savepoint sp1;
select func();
rollback to savepoint sp1;

Thanks for the report! I'll fix that.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: "Rafael Almeida"
Date:
Subject: BUG #5558: Problema com Bytea (BRASIL)
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #5558: Problema com Bytea (BRASIL)