Skip site navigation (1) Skip section navigation (2)

Re: BUG #2428: ERROR: out of memory, running INSERT SELECT statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Casey Duncan" <casey(at)pandora(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2428: ERROR: out of memory, running INSERT SELECT statement
Date: 2006-05-10 04:09:28
Message-ID: 25997.1147234168@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Casey Duncan" <casey(at)pandora(dot)com> writes:
> CREATE FUNCTION write_error_trigf() RETURNS trigger AS '
>     BEGIN
>         RAISE EXCEPTION ''Writes not allowed to this table on this node'';
>     END;
> ' LANGUAGE plpgsql;
> END; --Upgrade script

You did not show how this function is being used, but I'm wondering if
it is an AFTER trigger on inserts into ss?  If so, the reason for the
out-of-memory failure might be accumulation of pending trigger event
records.

Without wishing to defend our lack of ability to spill trigger events
to disk, you probably wouldn't be happy with the performance if it did
work :-(.  Consider making the trigger BEFORE instead of AFTER, so that
there's not a need to remember a ton of pending trigger firings.  I don't
see any reason why this trigger needs to be AFTER.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Lars HaugsethDate: 2006-05-10 12:54:41
Subject: Re: BUG #2429: Explain does not report object's schema
Previous:From: Cristiano DuarteDate: 2006-05-09 23:45:20
Subject: Re: BUG #2429: Explain does not report object's schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group