Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E329A1337B79 for ; Wed, 22 Dec 2010 00:10:01 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 11389-07 for ; Wed, 22 Dec 2010 04:09:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 18A9D1337990 for ; Wed, 22 Dec 2010 00:09:53 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oBM49pd8024072; Tue, 21 Dec 2010 23:09:51 -0500 (EST) To: Robert Haas cc: Fujii Masao , Tatsuhito Kasahara , pgsql-bugs@postgresql.org Subject: Re: memory leaks? using savepoint In-reply-to: References: <4D09BB92.6080309@oss.ntt.co.jp> <15534.1292538442@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 21 Dec 2010 22:58:30 -0500" Date: Tue, 21 Dec 2010 23:09:51 -0500 Message-ID: <24071.1292990991@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.897 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RISK_FREE=1.013, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/161 X-Sequence-Number: 28967 Robert Haas writes: > Are you saying that this problem does not exist in 8.3.0 but does > exist in later 8.3.x revs? I believe it dates from Author: Tom Lane Branch: master Release: REL8_4_BR [c98a92378] 2008-12-13 02:00:20 +0000 Branch: REL8_3_STABLE Release: REL8_3_6 [8d1d6019d] 2008-12-13 02:00:30 +0000 Branch: REL8_2_STABLE Release: REL8_2_12 [7ae3c0f67] 2008-12-13 02:00:53 +0000 Fix failure to ensure that a snapshot is available to datatype input functions when they are invoked by the parser. We had been setting up a snapshot at plan time but really it needs to be done earlier, before parse analysis. Per report from Dmitry Koterov. Also fix two related problems discovered while poking at this one: exec_bind_message called datatype input functions without establishing a snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without establishing a snapshot. Backpatch to 8.2. The underlying problem goes much further back, but it is masked in 8.1 and before because we didn't attempt to invoke domain check constraints within datatype input. It would only be exposed if a C-language datatype input function used the snapshot; which evidently none do, or we'd have heard complaints sooner. Since this code has changed a lot over time, a back-patch is hardly risk-free, and so I'm disinclined to patch further than absolutely necessary. So if we take the complaint seriously, we'd better patch 8.2 as well. regards, tom lane