Re: "invalid memory alloc request size <n>" in deferred trigger causes transaction to fail, but the backend keeps running

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: "invalid memory alloc request size <n>" in deferred trigger causes transaction to fail, but the backend keeps running
Date: 2004-12-03 22:27:37
Message-ID: 15107.1102112857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
> The only thing I can think of is that the handling of pol X and creation of
> pol Y from within spawn_pol() is somehow messing things up, but......

Certainly the mere firing of a deferred trigger isn't the problem; we do
that all the time. What struck me about the traceback you showed is
that it involved an attempt by the planner to constant-fold an
SQL-language function that was used in the trigger function's query
(and was presumably marked IMMUTABLE and had constant arguments in the
query).

Because the trigger function is plpgsql, this could happen only the
first time the trigger is fired in a particular session (unless you are
using EXECUTE to invoke the update command?). If the problem is related
to the planner constant-folding environment, then the first-time-only
limitation would help make it hard to reproduce.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Frank van Vugt 2004-12-03 23:01:58 Re: "invalid memory alloc request size <n>" in deferred trigger causes transaction to fail, but the backend keeps running
Previous Message Frank van Vugt 2004-12-03 22:14:54 Re: "invalid memory alloc request size <n>" in deferred trigger causes transaction to fail, but the backend keeps running