pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: christoph.berg@credativ.de
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15238: Sequence owner not updated when owning table is foreign
Date: Fri, 15 Jun 2018 13:06:10 +0900
Message-ID: <4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp> (raw)
In-Reply-To: <e3cf9eb8-add9-f523-b3f8-de657e091a14@2ndquadrant.com>
References: <152880968046.32363.3930397030469114276@wrigleys.postgresql.org>
	<e3cf9eb8-add9-f523-b3f8-de657e091a14@2ndquadrant.com>

On 2018/06/15 12:29, Peter Eisentraut wrote:
> On 6/12/18 09:21, PG Bug reporting form wrote:
>> If a foreign table has a sequence attached (e.g. if the foreign table has a
>> "serial" column), and the foreign table owner is updated, the sequence owner
>> is not updated, leading to errors on restore:
> 
> Yup, it only recurses to sequences for regular tables and materialized
> views.  I suggest to remove the relkind check altogether.  See attached
> patch.
> 
> Can materialized views even have serial columns?  I suspect materialized
> views entered this conditional because of the toast table check nearby.
> 
> Also, can partitioned tables have serial columns?  Are there more omissions?
> 
> So fewer relkind enumerations are probably better.

+1 to recursing without a relkind check.

Thanks,
Amit





view thread (10+ messages)  latest in thread

Message-ID: <4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp>
Permalink:  ../4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp

 · 

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: Langote_Amit_f8@lab.ntt.co.jp, peter.eisentraut@2ndquadrant.com, christoph.berg@credativ.de
  Subject: Re: BUG #15238: Sequence owner not updated when owning table is foreign
  In-Reply-To: <4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp>
  References: <152880968046.32363.3930397030469114276@wrigleys.postgresql.org> <e3cf9eb8-add9-f523-b3f8-de657e091a14@2ndquadrant.com> <4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp>

* 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