Re: BUG #2428: ERROR: out of memory, running INSERT SELECT statement - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2428: ERROR: out of memory, running INSERT SELECT statement
Date
Msg-id 25997.1147234168@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2428: ERROR: out of memory, running INSERT SELECT statement  ("Casey Duncan" <casey@pandora.com>)
Responses Re: BUG #2428: ERROR: out of memory, running INSERT SELECT statement
List pgsql-bugs
"Casey Duncan" <casey@pandora.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

pgsql-bugs by date:

Previous
From: Cristiano Duarte
Date:
Subject: Re: BUG #2429: Explain does not report object's schema
Next
From: Lars Haugseth
Date:
Subject: Re: BUG #2429: Explain does not report object's schema