Re: Out of Memory during Insert - Mailing list pgsql-general

From Tom Lane
Subject Re: Out of Memory during Insert
Date
Msg-id 20969.1269441005@sss.pgh.pa.us
Whole thread Raw
In response to Out of Memory during Insert  (yue peng <pengyuebupt@gmail.com>)
List pgsql-general
yue peng <pengyuebupt@gmail.com> writes:
> I encountered an out of memory error during executing un INSERT into
> table1(v1,v2,v3) SELECT  c1,c2,c3 from table2 where .....

Most likely the OOM is because of growth of the pending-trigger-event
queue --- do you have any foreign key references in that table?

Possible solutions are to insert fewer rows at a time, or to drop the FK
constraint and then re-create it after you do the bulk insertion.

You might also try updating to a newer PG version ... 8.4 and later use
only 12 bytes per pending INSERT trigger not 40.  That's not necessarily
going to be enough to fix this particular case, of course.

            regards, tom lane

pgsql-general by date:

Previous
From: Frank jansen
Date:
Subject: Re: Concatenate [solved]
Next
From: Bryan Murphy
Date:
Subject: Re: Warm Standby Setup Documentation