Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 49F171FA2A4A for ; Thu, 26 Jul 2012 02:27:44 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SuGbv-0004hE-7I for pgsql-bugs@postgresql.org; Thu, 26 Jul 2012 05:27:43 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q6Q5RI3Y011835; Thu, 26 Jul 2012 01:27:18 -0400 (EDT) From: Tom Lane To: karavelov@mail.bg cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6763: Severe memory leak with arrays and hstore In-reply-to: References: Comments: In-reply-to karavelov@mail.bg message dated "Thu, 26 Jul 2012 01:32:12 -0000" Date: Thu, 26 Jul 2012 01:27:17 -0400 Message-ID: <11834.1343280437@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/204 X-Sequence-Number: 33680 karavelov@mail.bg writes: > The query I have tried to use is: > INSERT INTO preferences > SELECT user_id,hstore(array_agg(name), array_agg(value)) > FROM old_prefs > GROUP BY user_id; > But the postgres backend consumed all the available memory (6G free + 4G > swap) and finally was killed by the kernel. Is there any reason to think this is an actual leak, and not just "you were trying to compute an impractically large value"? regards, tom lane