Kirk Wythers <kwythers@xxxxxxx> writes: > However, setting ulimit to unlimited does not seem to solve the > issue. After some experimentation I'm left wondering exactly what ulimit's -d option is for on OS X, because it sure doesn't seem to be limiting process data size. (I should have been suspicious of a value as small as 6 meg, anyway.) I tried selecting a large unconstrained join on my own OS X machine, and what I saw (watching with "top") was that the psql process VSIZE went up to 1.75Gb before it failed with the same error as Kirk got: regression=# select * from tenk1 a , tenk1 b; psql(16572) malloc: *** vm_allocate(size=8421376) failed (error code=3) psql(16572) malloc: *** error: can't allocate region psql(16572) malloc: *** set a breakpoint in szone_error to debug Since this is just a bog-standard Mini with 512M memory, it was pretty thoroughly on its knees by this point :-(. I'm not sure how to find out about allocated swap space in OS X, but my bet is that the above message should be understood as "totally out of virtual memory". My suggestion is to use a cursor to retrieve the data in more manageably-sized chunks than 7M rows. (If you don't want to mess with managing a cursor explicitly, as of 8.2 there's a psql variable FETCH_COUNT that can be set to make it happen behind the scenes.) regards, tom lane