Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h47iU-0002AZ-Ne for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 17:30:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h47iT-0003Ur-F9 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 17:30:57 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h47iT-0003Uk-7X for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 17:30:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h47iR-0005gj-9U for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 17:30:56 +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 x2DHUqCt007963; Wed, 13 Mar 2019 13:30:52 -0400 From: Tom Lane To: Robert Haas cc: Alvaro Herrera , PostgreSQL Hackers Subject: Re: hyrax vs. RelationBuildPartitionDesc In-reply-to: <7448.1552497345@sss.pgh.pa.us> References: <20190313164232.GA5270@alvherre.pgsql> <7448.1552497345@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 13 Mar 2019 13:15:45 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7960.1552498252.1@sss.pgh.pa.us> Date: Wed, 13 Mar 2019 13:30:52 -0400 Message-ID: <7961.1552498252@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > I recall having noticed someplace where I thought the relcache partition > support was simply failing to make provisions for cleaning up a cached > structure at relcache entry drop, but I didn't have time to pursue it > right then. Let me see if I can reconstruct what I was worried about. Ah, here we are: it was rel->rd_partcheck. I'm not sure exactly how complicated that structure can be, but I'm pretty sure that this is a laughably inadequate method of cleaning it up: if (relation->rd_partcheck) pfree(relation->rd_partcheck); Having it be loose data in CacheMemoryContext, which is the current state of affairs, is just not going to be practical to clean up. I suggest that maybe it could be copied into rd_partkeycxt or rd_pdcxt, so that it'd go away as a byproduct of freeing those. If there's a reason it has to be independent of both, it'll have to have its own small context. Dunno if that's related to hyrax's issue, though. regards, tom lane