## Robert Sosinski (rsosinski(at)ticketevolution(dot)com):
> 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@wrigleys.postgresql.org
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