Re: BUG #15238: Sequence owner not updated when owning table is foreign

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, christoph(dot)berg(at)credativ(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15238: Sequence owner not updated when owning table is foreign
Date: 2018-06-15 04:06:10
Message-ID: 4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-06-15 14:53:13 Re: row_to_json(), NULL values, and AS
Previous Message Andrew Gierth 2018-06-15 03:59:04 Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"