pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank van Vugt <ftm.van.vugt@foxi.nl>
To: pgsql-bugs@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: bug or simply not enough stack space?
Date: Fri, 17 Jul 2009 11:10:57 +0200
Message-ID: <200907171110.58371.ftm.van.vugt@foxi.nl> (raw)
In-Reply-To: <9169.1247755019@sss.pgh.pa.us>
References: <200907161545.20338.ftm.van.vugt@foxi.nl>
	<200907161630.29119.ftm.van.vugt@foxi.nl>
	<9169.1247755019@sss.pgh.pa.us>

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.




view thread (12+ messages)  latest in thread

Message-ID: <200907171110.58371.ftm.van.vugt@foxi.nl>
Permalink:  ../200907171110.58371.ftm.van.vugt@foxi.nl/
Also on:    postgresql.org/message-id/200907171110.58371.ftm.van.vugt@foxi.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ftm.van.vugt@foxi.nl, tgl@sss.pgh.pa.us
  Subject: Re: bug or simply not enough stack space?
  In-Reply-To: <200907171110.58371.ftm.van.vugt@foxi.nl>
  References: <200907161545.20338.ftm.van.vugt@foxi.nl> <200907161630.29119.ftm.van.vugt@foxi.nl> <9169.1247755019@sss.pgh.pa.us> <200907171110.58371.ftm.van.vugt@foxi.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox