## Robert Sosinski (rsosinski@xxxxxxxxxxxxxxxxxxx): > When using array_agg on a large table, memory usage seems to spike up until > Postgres crashes with the following error: This sounds like bug #7916. http://www.postgresql.org/message-id/E1UCeEU-0004hY-Pq@xxxxxxxxxxxxxxxxxxxxxxx As noted in that thread, changing the AllocSet parameters for acummArrayResult may help (call to AllocSetContextCreate() in ArrayBuildState *accumArrayResult(), src/backend/utils/adt/arrayfuncs.c, change ALLOCSET_DEFAULT_*SIZE to ALLOCSET_SMALL_*SIZE). Also, lowering work_mem may help, depending on your SQL. Regards, Christoph -- Spare Space -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general