Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 900E6632708 for ; Fri, 17 Jul 2009 06:11:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81492-09 for ; Fri, 17 Jul 2009 06:10:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gatefox.foxi.nl (foxi.xs4all.nl [194.109.246.192]) by mail.postgresql.org (Postfix) with ESMTP id 23AC6632ED3 for ; Fri, 17 Jul 2009 06:11:00 -0300 (ADT) Received: from techfox.localnet (techfox.foxi [192.168.0.79]) by gatefox.foxi.nl (8.14.2/8.14.2) with ESMTP id n6H9AwZB004237; Fri, 17 Jul 2009 11:10:58 +0200 From: Frank van Vugt Organization: Foxi Consultants in Technology BV To: pgsql-bugs@postgresql.org Subject: Re: bug or simply not enough stack space? Date: Fri, 17 Jul 2009 11:10:57 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.27.23-0.1-default; KDE/4.2.4; x86_64; ; ) Cc: Tom Lane References: <200907161545.20338.ftm.van.vugt@foxi.nl> <200907161630.29119.ftm.van.vugt@foxi.nl> <9169.1247755019@sss.pgh.pa.us> In-Reply-To: <9169.1247755019@sss.pgh.pa.us> X-message-flag: Fed up with inflexible software? Worried about this kind of behaviour? Have us explain Linux! Greetings from Foxi C.i.T. BV MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907171110.58371.ftm.van.vugt@foxi.nl> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.018 tagged_above=0 required=5 tests=AWL=0.018 X-Spam-Level: X-Archive-Number: 200907/223 X-Sequence-Number: 23685 Ok, So this took a while, but here's your test case..... Turns out to be quite small actually ;) create table t1 (id int); CREATE FUNCTION tr_t1_after_iud() RETURNS trigger LANGUAGE 'plpgsql' VOLATILE STRICT SECURITY INVOKER AS 'DECLARE BEGIN RAISE NOTICE ''%'', ROW(NEW.*); SELECT 1/0; RETURN NEW; END;'; CREATE TRIGGER t1_after AFTER INSERT OR UPDATE OR DELETE ON t1 FOR EACH ROW EXECUTE PROCEDURE tr_t1_after_iud(); begin; savepoint s1; INSERT INTO t1 values (1); => this will result in the following: db=# INSERT INTO t1 values (1); NOTICE: (1) WARNING: AbortSubTransaction while in ABORT state WARNING: did not find subXID 77063 in MyProc ERROR: division by zero CONTEXT: SQL statement "SELECT 1/0" PL/pgSQL function "tr_t1_after_iud" line 4 at SQL statement ERROR: tupdesc reference 0x7ffe74f24ad0 is not owned by resource owner SubTransaction => mind the fact that the savepoint is 'needed', without it there will be no problem => in my reallife example, this resulted in a "PANIC: ERRORDATA_STACK_SIZE exceeded", I cannot reproduce that, but as you stated earlier, this might just be collateral damage, which I'll be able to easily confirm once the problem above has been fixed. => cleanup: rollback; drop table t1; drop function tr_t1_after_iud(); => to avoid possible confusion db=# select version(); version --------------------------------------------------------------------------------------- PostgreSQL 8.4.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.2.4, 64-bit Looking forward to your reply. -- Best, Frank.