Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xi3in-0002Om-2C for pgsql-bugs@arkaria.postgresql.org; Sat, 25 Oct 2014 15:57:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xi3il-0002ci-It for pgsql-bugs@arkaria.postgresql.org; Sat, 25 Oct 2014 15:57:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xi3ik-0002cb-Gk for pgsql-bugs@postgresql.org; Sat, 25 Oct 2014 15:57:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xi3ig-0007kY-QV for pgsql-bugs@postgresql.org; Sat, 25 Oct 2014 15:57:36 +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 s9PFvPNT006759; Sat, 25 Oct 2014 11:57:25 -0400 From: Tom Lane To: =?UTF-8?B?RHVuYXVza2FzIE9sZWc=?= cc: =?UTF-8?B?UGF2ZWwgU3RlaHVsZQ==?= , =?UTF-8?B?cGdzcWwtYnVnc0Bwb3N0Z3Jlc3FsLm9yZw==?= , =?UTF-8?B?SGVpa2tpIExpbm5ha2FuZ2Fz?= Subject: Re: =?UTF-8?B?UmVbMl06IFtCVUdTXSBCVUcgIzExNzYxOiByYW5nZV9pbiBkb3NuJ3Qgd29y?= =?UTF-8?B?ayB2aWEgZGlyZWN0IGZ1bmN0aW9uYWwgY2FsbA==?= In-reply-to: <1414171965.135034595@f243.i.mail.ru> References: <20141022172703.2662.31056@wrigleys.postgresql.org> <544A4F4E.9080407@vmware.com> <1414171965.135034595@f243.i.mail.ru> Comments: In-reply-to =?UTF-8?B?RHVuYXVza2FzIE9sZWc=?= message dated "Fri, 24 Oct 2014 21:32:45 +0400" Date: Sat, 25 Oct 2014 11:57:25 -0400 Message-ID: <6758.1414252645@sss.pgh.pa.us> X-Pg-Spam-Score: -3.4 (---) 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 =?UTF-8?B?RHVuYXVza2FzIE9sZWc=?= writes: > And one more question, for example, I do some memory allocation via palloc in _PG_Init(). > Is this memory preserve for all life time after library is loaded into postgresql process? Probably not --- CurrentMemoryContext would most likely be pointing at a statement-lifespan context. If you want that behavior, I'd recommend explicitly allocating in TopMemoryContext. (Also, you would not be needing to ask that question if you were using an --enable-cassert build for testing. Which is *highly* recommended when developing C code for Postgres.) 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