Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfCkl-0003IB-V8 for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Aug 2017 22:13:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dfCkk-0002OP-8q for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Aug 2017 22:13:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dfCk3-00017l-4d for pgsql-bugs@postgresql.org; Tue, 08 Aug 2017 22:12:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dfCjz-0005gQ-Cx for pgsql-bugs@postgresql.org; Tue, 08 Aug 2017 22:12:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v78MCZIj025046; Tue, 8 Aug 2017 18:12:36 -0400 From: Tom Lane To: Andres Freund cc: Rick Otten , ronan.dunklau@dalibo.com, PostgreSQL mailing lists , Amit Kapila , Robert Haas Subject: Re: your mail In-reply-to: <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de> References: <20170808194943.smet3uuvtxats44v@alap3.anarazel.de> <15541.1502223315@sss.pgh.pa.us> <20170808201838.vt5lyujd3fvgtxyq@alap3.anarazel.de> <17591.1502226734@sss.pgh.pa.us> <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 08 Aug 2017 14:19:41 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25044.1502230355.1@sss.pgh.pa.us> Date: Tue, 08 Aug 2017 18:12:35 -0400 Message-ID: <25045.1502230355@sss.pgh.pa.us> 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 Andres Freund writes: > On 2017-08-08 17:12:14 -0400, Tom Lane wrote: >> And it would cause a lot of code that *doesn't* assume that to fail, >> too. That has basically nothing to do with not being in a transaction, >> so I don't think it would be helpful here. > Wouldn't mostsuch code be a bad idea anyway? No, not really. You're right that a palloc appearing directly in a _PG_init function is a bit dubious, but that doesn't mean that _PG_init can't call anything that allocates memory. Also, since _PG_init is by definition only called once per process, I do not think that authors need to be rapped on the knuckles if they leak a small amount of TopMemoryContext memory. In any case, the result of doing that would only be that people would throw in MemoryContextSwitchTo calls, it wouldn't discourage them from trying to do catalog accesses for instance. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs