Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X2QH6-0005At-Tt for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jul 2014 19:33:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X2QH6-0006MR-ET for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jul 2014 19:33:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X2QH5-0006ML-Gk for pgsql-bugs@postgresql.org; Wed, 02 Jul 2014 19:32:59 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X2QH2-00033n-KZ for pgsql-bugs@postgresql.org; Wed, 02 Jul 2014 19:32:57 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1X2QH1-00085j-3k; Wed, 02 Jul 2014 15:32:55 -0400 Date: Wed, 2 Jul 2014 15:32:55 -0400 From: Bruce Momjian To: Alvaro Herrera Cc: Andres Freund , PostgreSQL Bugs Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts Message-ID: <20140702193255.GB20463@momjian.us> References: <20140619015205.GD3806@momjian.us> <20140619014034.GC3806@momjian.us> <20140619220425.GQ18688@eldon.alvh.no-ip.org> <20140620010653.GS18688@eldon.alvh.no-ip.org> <20140620180725.GD29143@momjian.us> <20140624201346.GB17110@momjian.us> <20140627210520.GP7340@eldon.alvh.no-ip.org> <20140701161419.GA16033@momjian.us> <20140701190105.GA7340@eldon.alvh.no-ip.org> <20140701193047.GB16033@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140701193047.GB16033@momjian.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Tue, Jul 1, 2014 at 03:30:47PM -0400, Bruce Momjian wrote: > > * When upgrading from 9.2 or older, all tables need to have relminmxid > > set to oldestMulti. However, since pg_dump --binary-upgrade cannot > > extract useful values from the catalog, we will need to have the > > schema load create all tables with relminmxid=0. A subsequent UPDATE > > will fix the values. > > OK, the updated attached patch does this. It repurposes > set_frozenxids(). OK, patch applied back through 9.3. This leaves the two queries users are going to have to run in 9.3.X. The first will tell users if they should remove offsets/0000: WITH list(file) AS ( SELECT * FROM pg_ls_dir('pg_multixact/offsets') ) SELECT EXISTS (SELECT * FROM list WHERE file = '0000') AND NOT EXISTS (SELECT * FROM list WHERE file = '0001') AND NOT EXISTS (SELECT * FROM list WHERE file = 'FFFF') AND EXISTS (SELECT * FROM list WHERE file != '0000') AS file_0000_removal_required; The second will tell them if they should go to a wiki page that will show them how to set database and relation minmxid values: WITH list(file) AS ( SELECT * FROM pg_ls_dir('pg_multixact/offsets') ) SELECT EXISTS (SELECT * FROM list WHERE file ~ '^[8-9A-F]') AND EXISTS (SELECT * FROM pg_database WHERE datminmxid = 1) AS update_database_and_relation_minmxid; I will work on the wiki page now. I think this issue is now ready for 9.3.X, once we write the wiki page and release note text. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs