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 1eyMQ6-0006mv-56 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 18:55:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eyMQ5-0006t4-4F for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 18:55:37 +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 1eyMQ4-0006sv-TC for pgsql-hackers@lists.postgresql.org; Tue, 20 Mar 2018 18:55:36 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyMQ1-0005wk-Cc for pgsql-hackers@lists.postgresql.org; Tue, 20 Mar 2018 18:55:36 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id E1CA51465; Tue, 20 Mar 2018 14:55:31 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Tue, 20 Mar 2018 14:55:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Xh0YNK14nju41Fng8 jImB5mZqucItbmqDsC1dhsRzEg=; b=Ui6TobiZ++6N6oR2jlMs1L7eaeQ+1oVsE na8LTMCS113ujsPP0scp9nNhhpaDKjM79SgAz0InC+W7u1sn8CLzVSQI/MLwDElX hFubS7FJQ+evrIzXCBgMwtcvFGzuwEMwP+N1WUdwaxVb8w9A5m4Xivs0kmj0nrOh pqSk/BkBATXA6e4uFxTWxXNaq8N1PObHceZOxu14W4VdThcxpPH4Fp6wTGjZrw+J 5W6Wx4tMGttmbhk44e586zF8MBANlLJjkW6SvwNf/QalCkGJMHo6NIerewrAVaUi GOkJ2yUG9Y53finh6yjSvCsPQJsYtNmfbbq/QC29rKgzhvsUjlnNA== X-ME-Sender: Received: from alvin.alvh.no-ip.org (unknown [179.56.29.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 3DC34241E3; Tue, 20 Mar 2018 14:55:31 -0400 (EDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id A8ABD7BF; Tue, 20 Mar 2018 15:55:29 -0300 (-03) Date: Tue, 20 Mar 2018 15:55:29 -0300 From: Alvaro Herrera To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, Jeevan Ladhe , Robert Haas Subject: Re: pgsql: Fix CommandCounterIncrement in partition-related DDL Message-ID: <20180320185529.sf3wym5gdfnczd4m@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <21120.1521571066@sss.pgh.pa.us> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane wrote: > 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. Actually, the current code uses CacheInvalidateRelcache() already and it seems to work; I was looking for a better way that did not require us to remember it for every update in that catalog, but it seems there isn't one. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services