Re: Errors creating partitioned tables from existing using (LIKE <table>) after renaming table constraints
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: Stuart <sfbarbee@gmail.com>, pgsql-bugs@postgresql.org
Date: 2018-12-17T01:41:07Z
Lists: pgsql-bugs
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
Commits
-
Make constraint rename issue relcache invalidation on target relation
- d5d86e2cd6b8 9.4.21 landed
- 5812be7b63cf 9.5.16 landed
- d79cd555da11 9.6.12 landed
- da13d90a5fba 10.7 landed
- 25b8094d33ac 11.2 landed
- b13fd344c5fc 12.0 landed