On Sat, 2009-10-17 at 20:02 -0700, yuliada wrote: > I have a large database and I'm trying to execute delete on a table which > has some related tables. The query fails with following error: > ERROR: out of memory > DETAIL: Failed on request of size 1048576. > > I'm new to postgresql and I'm currently trying to figure out what to do by > myself. I've played with some config memory parameters, but with no luck by > now. It would be great if somebody could tell me how to solve it or give any > clues on why it happens or in which direction to search. > > Here is the log: > > AfterTriggerEvents: 872443512 total in 839 blocks; 9152 free (5 chunks); > 872434360 used The RI triggers are causing the out of memory situation, it would appear. You'll need to either * use Truncate * run a series of smaller transactions to delete the rows * insert the rows you wish to keep into a new table then add RI to it, drop the old, rename the new. -- Simon Riggs www.2ndQuadrant.com -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general