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-Tag: REL8_2_6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a4a7d624a51d4a9747bbb3df126802f9df44f4a;p=thirdparty%2Fpostgresql.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 c37b3672781..dfd95562784 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -3,7 +3,7 @@ * header file for postgres inverted index access method implementation. * * Copyright (c) 2006, PostgreSQL Global Development Group - * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.9 2006/10/05 17:57:40 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.9.2.1 2007/11/16 21:50:13 tgl Exp $ *-------------------------------------------------------------------------- */ @@ -450,7 +450,7 @@ typedef struct uint32 maxdepth; EntryAccumulator **stack; uint32 stackpos; - uint32 allocatedMemory; + long allocatedMemory; uint32 length; EntryAccumulator *entryallocator;