Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoG2b-0001YK-7i for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 22:05:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoG2a-0007H5-Bl for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 22:05:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eoG2a-0007Gv-2u for pgsql-bugs@lists.postgresql.org; Tue, 20 Feb 2018 22:05:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoG2X-0008Dj-Nq for pgsql-bugs@postgresql.org; Tue, 20 Feb 2018 22:05:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1KM5TH3025876; Tue, 20 Feb 2018 17:05:29 -0500 From: Tom Lane To: Andres Freund cc: Claudio Freire , pgsql-bugs@postgresql.org Subject: Re: pg_upgrade and materialized views In-reply-to: <20180220215420.cdmx6bfqtzasjjcs@alap3.anarazel.de> References: <20180220215420.cdmx6bfqtzasjjcs@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 20 Feb 2018 13:54:20 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25874.1519164329.1@sss.pgh.pa.us> Date: Tue, 20 Feb 2018 17:05:29 -0500 Message-ID: <25875.1519164329@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > The important part then happens in pg_dump. Note > if (dopt->binary_upgrade && > (tbinfo->relkind == RELKIND_RELATION || > tbinfo->relkind == RELKIND_FOREIGN_TABLE || > tbinfo->relkind == RELKIND_PARTITIONED_TABLE)) > note that the above if clause doesn't include materialized tables. Which > sems to explain this bug? Could you check that just updating the above > if to include matviews fixes the bug for you? I'm also wondering why it *does* include foreign tables. Surely relfrozenxid is meaningless for a FT? > Looking into this I also saw: > set_frozenxids(bool minmxid_only) > which makes a bit uncomfortable, but I can't quite put my finger on > why. The fact that it's inconsistent with the other list is surely a red flag, eg seems like we should include RELKIND_PARTITIONED_TABLE there too. regards, tom lane