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 1gYhuT-0000md-AC for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Dec 2018 01:41:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gYhuQ-000590-Sv for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Dec 2018 01:41:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYhuQ-00058t-JI for pgsql-bugs@lists.postgresql.org; Mon, 17 Dec 2018 01:41:26 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gYhuM-0006aO-GN for pgsql-bugs@postgresql.org; Mon, 17 Dec 2018 01:41:25 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wBH1fDfV008987; Mon, 17 Dec 2018 10:41:13 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 771AB63858D; Mon, 17 Dec 2018 10:41:13 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 6BE87638580; Mon, 17 Dec 2018 10:41:13 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 66DEC4007CE; Mon, 17 Dec 2018 10:41:13 +0900 (JST) Subject: Re: Errors creating partitioned tables from existing using (LIKE ) after renaming table constraints References: <2047094.V130LYfLq4@station53.ousa.org> <977c72a1-8d56-b77c-37de-808627033654@lab.ntt.co.jp> <20181214002038.GC2921@paquier.xyz> <20181216072703.GK5012@paquier.xyz> From: Amit Langote Message-ID: <3dcf4d65-313c-b629-86f5-8e06ec42d92f@lab.ntt.co.jp> Date: Mon, 17 Dec 2018 10:41:07 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181216072703.GK5012@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Michael Paquier Cc: Stuart , pgsql-bugs@postgresql.org X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Thanks for reviewing. On 2018/12/16 16:27, Michael Paquier wrote: > On Fri, Dec 14, 2018 at 11:19:16AM +0900, Amit Langote wrote: >> Thank you for looking. I noticed that the previously posted patch doesn't >> apply as is to branches before 11, so here are the patches that apply to >> 9.4 to 10 branches. > > When renaming an attribute, renameatt_internal is in charge of > invalidating the cache by using CacheInvalidateHeapTuple when running > the catalog update in CatalogTupleUpdate. > > For constraint renames, we may finish by using RenameConstraintById or > RenameRelationInternal. And here the constraint is removed by OID where > a invalidation happens for the constraint, but not its parent relation. > In short I agree with your fix and its position, still I think that we > should add a comment why the invalidation needs to happen, with > something simple, like "Invalidate relcache so as others can see the new > constraint name". Yeah, a comment is indeed needed. > I'll try to get that committed tomorrow and back-patched appropriately. Thank you for adding the comment and committing. :) Regards, Amit