"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