pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Stuart <sfbarbee@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Errors creating partitioned tables from existing using (LIKE <table>) after renaming table constraints
Date: Sun, 16 Dec 2018 16:27:03 +0900
Message-ID: <20181216072703.GK5012@paquier.xyz> (raw)
In-Reply-To: <d6975ae7-e82a-75d7-fe35-91145cb6265b@lab.ntt.co.jp>
References: <2047094.V130LYfLq4@station53.ousa.org>
	<977c72a1-8d56-b77c-37de-808627033654@lab.ntt.co.jp>
	<20181214002038.GC2921@paquier.xyz>
	<d6975ae7-e82a-75d7-fe35-91145cb6265b@lab.ntt.co.jp>

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".

I'll try to get that committed tomorrow and back-patched appropriately.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (12+ messages)  latest in thread

Message-ID: <20181216072703.GK5012@paquier.xyz>
Permalink:  ../20181216072703.GK5012@paquier.xyz/
Also on:    postgresql.org/message-id/20181216072703.GK5012@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, Langote_Amit_f8@lab.ntt.co.jp, sfbarbee@gmail.com
  Subject: Re: Errors creating partitioned tables from existing using (LIKE <table>) after renaming table constraints
  In-Reply-To: <20181216072703.GK5012@paquier.xyz>
  References: <2047094.V130LYfLq4@station53.ousa.org> <977c72a1-8d56-b77c-37de-808627033654@lab.ntt.co.jp> <20181214002038.GC2921@paquier.xyz> <d6975ae7-e82a-75d7-fe35-91145cb6265b@lab.ntt.co.jp> <20181216072703.GK5012@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox