"Mark Woodward" <pgsql(at)mohawksoft(dot)com> writes:
> Again, regardless of OS used, hashagg will exceed "working memory" as
> defined in postgresql.conf.
So? If you've got OOM kill enabled, it can zap a process whether it's
strictly adhered to work_mem or not. The OOM killer is entirely capable
of choosing a victim process whose memory footprint hasn't changed
materially since it started (eg, the postmaster).
regards, tom lane