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 1lKNPn-00076n-Ud for pgsql-admin@arkaria.postgresql.org; Thu, 11 Mar 2021 15:39:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKNPm-00008R-FL for pgsql-admin@arkaria.postgresql.org; Thu, 11 Mar 2021 15:39:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKNPm-00008G-82 for pgsql-admin@lists.postgresql.org; Thu, 11 Mar 2021 15:39:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKNPf-0006lG-PL for pgsql-admin@lists.postgresql.org; Thu, 11 Mar 2021 15:39:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12BFdkEW2292522; Thu, 11 Mar 2021 10:39:46 -0500 From: Tom Lane To: Bruce Momjian cc: Paul Smith , pgsql-admin@lists.postgresql.org Subject: Re: Using pg_upgrade to change from 32 to 64 bit. In-reply-to: <20210311145712.GE2469@momjian.us> References: <33cc9b29-b14e-583e-88eb-32bc4006cc9d@pscs.co.uk> <20210311145712.GE2469@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Thu, 11 Mar 2021 09:57:12 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2292520.1615477186.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 11 Mar 2021 10:39:46 -0500 Message-ID: <2292521.1615477186@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > On Thu, Mar 11, 2021 at 10:34:42AM +0000, Paul Smith wrote: >> Just "for kicks" I decided to try to use pg_upgrade to do it (on a test >> database).=C2=A0 The documentation seems to suggest that it won't work >> "pg_upgrade=C2=A0does its best to make sure the old and new clusters ar= e >> binary-compatible, e.g., by checking for compatible compile-time settin= gs, >> *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. Yeah, it will (probably) work as long as maxAlign is the same. Since on Intel hardware that's pretty nearly a free choice by the compiler, it doesn't surprise me if 32- and 64-bit Windows builds use the same value. > 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. After some digging, I found where pg_upgrade checks that the clusters' pg_control.maxAlign settings match. However, it looks to me like pg_control.floatFormat is never checked, which is a problem in theory though I'm not sure there's any issue in practice, seeing how universal IEEE floats are. Perhaps more critical, it's not apparent to me where or how pg_upgrade verifies that endianness is the same. regards, tom lane