Jonathan Vanasco <postgres@2xlp.com> writes:
> except instead of relying on a leak to increase memory, I'd like a
> rather intensive large function with a dataset to consumer massive
> amounts of ram. I just can't think of any function to do that.
Sort a big chunk of data with a high work_mem setting, eg
select random() from generate_series(1,1000000) order by 1;
or
select count(*) from
(select random() from generate_series(1,1000000) order by 1) ss;
The former will drive psql's memory usage up too, the latter not.
regards, tom lane