Re: BUG #15238: Sequence owner not updated when owning table isforeign - Mailing list pgsql-bugs

From Amit Langote
Subject Re: BUG #15238: Sequence owner not updated when owning table isforeign
Date
Msg-id 4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp
Whole thread Raw
In response to Re: BUG #15238: Sequence owner not updated when owning table isforeign  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: BUG #15238: Sequence owner not updated when owning table isforeign  (Christoph Berg <christoph.berg@credativ.de>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #15238: Sequence owner not updated when owning table isforeign
Next
From: Tom Lane
Date:
Subject: Re: row_to_json(), NULL values, and AS