Frank van Vugt <ftm.van.vugt@foxi.nl> writes:
> So this took a while, but here's your test case.....
> Turns out to be quite small actually ;)
Hmm ... the relevant code change seems to have been
http://archives.postgresql.org/pgsql-committers/2009-04/msg00127.php
I think I might have been overenthusiastic in trying to free resources
during a subtransaction abort. Try this patch and see if you notice
any bad side-effects.
regards, tom lane
Index: src/pl/plpgsql/src/pl_exec.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v
retrieving revision 1.244
diff -c -r1.244 pl_exec.c
*** src/pl/plpgsql/src/pl_exec.c 17 Jun 2009 13:46:12 -0000 1.244
--- src/pl/plpgsql/src/pl_exec.c 17 Jul 2009 16:12:22 -0000
***************
*** 5292,5298 ****
{
SimpleEcontextStackEntry *next;
! FreeExprContext(simple_econtext_stack->stack_econtext);
next = simple_econtext_stack->next;
pfree(simple_econtext_stack);
simple_econtext_stack = next;
--- 5292,5299 ----
{
SimpleEcontextStackEntry *next;
! if (event == SUBXACT_EVENT_COMMIT_SUB)
! FreeExprContext(simple_econtext_stack->stack_econtext);
next = simple_econtext_stack->next;
pfree(simple_econtext_stack);
simple_econtext_stack = next;