Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyM8y-0005tC-LE for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 18:37:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eyM8w-00066w-LJ for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 18:37:54 +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.89) (envelope-from ) id 1eyM8w-00066n-Eb for pgsql-hackers@lists.postgresql.org; Tue, 20 Mar 2018 18:37:54 +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.89) (envelope-from ) id 1eyM8t-0005Sz-Nl for pgsql-hackers@lists.postgresql.org; Tue, 20 Mar 2018 18:37:53 +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 w2KIbk0d021121; Tue, 20 Mar 2018 14:37:46 -0400 From: Tom Lane To: Alvaro Herrera cc: pgsql-hackers@lists.postgresql.org, Jeevan Ladhe , Robert Haas Subject: Re: pgsql: Fix CommandCounterIncrement in partition-related DDL In-reply-to: <20180320182659.nyzn3vqtjbbtfgwq@alvherre.pgsql> References: <20180320182659.nyzn3vqtjbbtfgwq@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 20 Mar 2018 15:26:59 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21119.1521571066.1@sss.pgh.pa.us> Date: Tue, 20 Mar 2018 14:37:46 -0400 Message-ID: <21120.1521571066@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > I wonder about adding a syscache callback so that when an item in > pg_partitioned_table is invalidated, the relcache entry for partrelid > entry in pg_class is invalidated also. I can't find any precedent for > anything similar, though, and there doesn't seem to be any convenient > place to do it, either. In principle you could do it by adding logic to CacheInvalidateHeapTuple in inval.c, similar to the existing logic for pg_class, pg_attribute and pg_index entries. Not sure it's worthwhile though. That's very ancient code; of late our practice has been to insist that the code modifying other catalogs that feed into relcache entries should issue a relcache inval explicitly. If there's a reason why it's not convenient to do that, then maybe making CacheInvalidateHeapTuple do it is a good way. regards, tom lane