Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOot9-0003ky-24 for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Sep 2013 13:12:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VOot8-00046r-IS for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Sep 2013 13:12:18 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOot7-00046l-Sr for pgsql-bugs@postgresql.org; Wed, 25 Sep 2013 13:12:18 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOot4-0006WJ-Nx for pgsql-bugs@postgresql.org; Wed, 25 Sep 2013 13:12:17 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 6673C299EA; Wed, 25 Sep 2013 06:12:13 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 641E5B04AA; Wed, 25 Sep 2013 06:12:13 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 0BACA120031; Wed, 25 Sep 2013 06:19:07 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 25 Sep 2013 06:19:05 -0700 (PDT) Message-ID: <5242E129.4090903@vmware.com> Date: Wed, 25 Sep 2013 16:12:09 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: marian.krucina@gmail.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #8468: Create index on type tstzrange fail References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -8.9 (--------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 24.09.2013 14:42, marian.krucina@gmail.com wrote: > CREATE INDEX ON tstzrange fail on 9.3.0 and 9.2.4 - default postgres > configuration. > It ate whole memory and was killed by oom. > > > Example: > postgres=# CREATE TABLE range_test AS SELECT tstzrange(t, t+'1min') tr FROM > generate_series('2000-1-1'::TIMESTAMPTZ, '2010-1-1'::TIMESTAMPTZ, '1min') AS > t1(t); > SELECT 5260321 > postgres=# CREATE INDEX ON range_test(tr); > WARNING: terminating connection because of crash of another server process > DETAIL: The postmaster has commanded this server process to roll back the > current transaction and exit, because another server process exited > abnormally and possibly corrupted shared memory. > HINT: In a moment you should be able to reconnect to the database and > repeat your command. > The connection to the server was lost. Attempting reset: Failed. A-ha, the comparison function of range datatypes, range_cmp(), detoasts its arguments, but fails to free the detoasted copies. Functions are normally not required to free such temporary copies - the memory is usually leaked into a short-lived memory context that will be quickly free'd anyway - but B-tree comparison operators are expected to not leak. Committed a fix, it will appear in the next minor releases. Thanks for the report! - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs