Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTg4D-00040h-LE for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Jun 2018 04:10:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fTg4C-0004xN-KF for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Jun 2018 04:10:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTg0a-0008Lb-0v for pgsql-bugs@lists.postgresql.org; Fri, 15 Jun 2018 04:06:44 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fTg0T-0001kW-I9 for pgsql-bugs@lists.postgresql.org; Fri, 15 Jun 2018 04:06:42 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w5F46NCi031434; Fri, 15 Jun 2018 13:06:23 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id F03AC638831; Fri, 15 Jun 2018 13:06:22 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id E3C17638535; Fri, 15 Jun 2018 13:06:22 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id D43EC400336; Fri, 15 Jun 2018 13:06:22 +0900 (JST) Subject: Re: BUG #15238: Sequence owner not updated when owning table is foreign References: <152880968046.32363.3930397030469114276@wrigleys.postgresql.org> From: Amit Langote Message-ID: <4163c7cb-bc8f-3767-21e7-e9dee69df04c@lab.ntt.co.jp> Date: Fri, 15 Jun 2018 13:06:10 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Peter Eisentraut , christoph.berg@credativ.de, pgsql-bugs@lists.postgresql.org X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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