Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMkY-0004vq-BO for pgsql-admin@arkaria.postgresql.org; Thu, 11 Mar 2021 14:57:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKMkX-0001Ws-96 for pgsql-admin@arkaria.postgresql.org; Thu, 11 Mar 2021 14:57:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMkX-0001V2-1f for pgsql-admin@lists.postgresql.org; Thu, 11 Mar 2021 14:57:17 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMkU-0001Ce-OJ for pgsql-admin@lists.postgresql.org; Thu, 11 Mar 2021 14:57:16 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lKMkS-0005Vw-Lj; Thu, 11 Mar 2021 09:57:12 -0500 Date: Thu, 11 Mar 2021 09:57:12 -0500 From: Bruce Momjian To: Paul Smith Cc: pgsql-admin@lists.postgresql.org Subject: Re: Using pg_upgrade to change from 32 to 64 bit. Message-ID: <20210311145712.GE2469@momjian.us> References: <33cc9b29-b14e-583e-88eb-32bc4006cc9d@pscs.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <33cc9b29-b14e-583e-88eb-32bc4006cc9d@pscs.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 11, 2021 at 10:34:42AM +0000, Paul Smith wrote: > Hi, we've been using 32 bit PostgreSQL 9.5 on Windows and are seeing how we > could upgrade to v13 64 bit. > > As far as I can see from the documentation and other discussion on the > Internet, the only way to do this is to do a pg_dump and pg_restore, which > could take a while with a large database. > > Just "for kicks" I decided to try to use pg_upgrade to do it (on a test > database).  The documentation seems to suggest that it won't work > > "pg_upgrade does its best to make sure the old and new clusters are > binary-compatible, e.g., by checking for compatible compile-time settings, > *including 32/64-bit binaries*." > > To my surprise, it seemed to work absolutely fine. I can start the new 64 bit > cluster, and a quick check shows everything working OK. > > Is this to be expected? Was it a fluke? I'd expect it to refuse to work rather > than claim to work and give me a broken database. Well, pg_upgrade checks all the pg_controldata fields that would affect compatibility, so I guess it does work. pg_upgrade only really cares about the format of the database files, not the size of pointers used by the binary. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee