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

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: 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 03:29:19
Message-ID: e3cf9eb8-add9-f523-b3f8-de657e091a14@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Recurse-to-sequences-on-ownership-change-for-all-rel.patch text/plain 2.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2018-06-15 03:40:01 Re: BUG #15238: Sequence owner not updated when owning table is foreign
Previous Message Justin Pryzby 2018-06-15 01:38:00 Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"