From: Tom Lane Date: Fri, 16 Nov 2007 21:50:13 +0000 (+0000) Subject: GIN index build's allocatedMemory counter needs to be long, not uint32. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=bf468c9aa476face617974d53f0cc58b40da12e9;p=users%2Fbernd%2Fpostgres.git GIN index build's allocatedMemory counter needs to be long, not uint32. Else, in a 64-bit machine with maintenance_work_mem set to above 4Gb, the counter overflows and we never recognize having reached the maintenance_work_mem limit. I believe this explains out-of-memory failure recently reported by Sean Davis. This is a bug, so backpatch to 8.2. --- diff --git a/src/include/access/gin.h b/src/include/access/gin.h index 15d84ba4dc..5d584946df 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -450,7 +450,7 @@ typedef struct uint32 maxdepth; EntryAccumulator **stack; uint32 stackpos; - uint32 allocatedMemory; + long allocatedMemory; uint32 length; EntryAccumulator *entryallocator;