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 1eoFTx-00078Q-FP for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 21:29:49 +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 1eoFTu-0001xH-SO for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 21:29:46 +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.84_2) (envelope-from ) id 1eoFS4-0003kp-4W for pgsql-bugs@lists.postgresql.org; Tue, 20 Feb 2018 21:27:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoFRz-0007vd-12 for pgsql-bugs@postgresql.org; Tue, 20 Feb 2018 21:27:50 +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 w1KLRiEI023576; Tue, 20 Feb 2018 16:27:44 -0500 From: Tom Lane To: Claudio Freire cc: pgsql-bugs@postgresql.org Subject: Re: pg_upgrade and materialized views In-reply-to: References: Comments: In-reply-to Claudio Freire message dated "Tue, 20 Feb 2018 18:13:26 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23574.1519162064.1@sss.pgh.pa.us> Date: Tue, 20 Feb 2018 16:27:44 -0500 Message-ID: <23575.1519162064@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Claudio Freire writes: > I'm not 100% sure this is a pg_upgrade bug or a pg_dump > --binary-upgrade one, or some other thing, but at this point I'm > fairly certain there's something wrong in one of them. The symptoms you're mentioning suggest two bugs: (1) it's not clear why binary upgrade should treat a matview's relfrozenxid differently from a regular table's; (2) independently of that, it sounds like REFRESH MATERIALIZED VIEW CONCURRENTLY is somehow preventing advancement of the matview's relfrozenxid in the source DB. > I just tried to pg_upgrade a database from 9.5 to 10.2. I took a > snapshot off a replica, promoted it, and then did the pg_upgrade there > (to avoid breaking our production server). And that brings replication behavior into the mix, too :-(. I'd suggest seeing if you can duplicate these problems without any replication involved. regards, tom lane