pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedUsing pg_upgrade to change from 32 to 64 bit.
3+ messages / 3 participants
[nested] [flat]
* Using pg_upgrade to change from 32 to 64 bit.
@ 2021-03-11 10:34 Paul Smith <paul@pscs.co.uk>
2021-03-11 14:57 ` Re: Using pg_upgrade to change from 32 to 64 bit. Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 3+ messages in thread
From: Paul Smith @ 2021-03-11 10:34 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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_upgradedoes 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.
--
Paul
Paul Smith Computer Services
support@pscs.co.uk - 01484 855800
--
Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53
Sign up for news & updates at http://www.pscs.co.uk/go/subscribe
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Using pg_upgrade to change from 32 to 64 bit.
2021-03-11 10:34 Using pg_upgrade to change from 32 to 64 bit. Paul Smith <paul@pscs.co.uk>
@ 2021-03-11 14:57 ` Bruce Momjian <bruce@momjian.us>
2021-03-11 15:39 ` Re: Using pg_upgrade to change from 32 to 64 bit. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Momjian @ 2021-03-11 14:57 UTC (permalink / raw)
To: Paul Smith <paul@pscs.co.uk>; +Cc: pgsql-admin@lists.postgresql.org
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 <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Using pg_upgrade to change from 32 to 64 bit.
2021-03-11 10:34 Using pg_upgrade to change from 32 to 64 bit. Paul Smith <paul@pscs.co.uk>
2021-03-11 14:57 ` Re: Using pg_upgrade to change from 32 to 64 bit. Bruce Momjian <bruce@momjian.us>
@ 2021-03-11 15:39 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2021-03-11 15:39 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Paul Smith <paul@pscs.co.uk>; pgsql-admin@lists.postgresql.org
Bruce Momjian <bruce@momjian.us> 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). 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.
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-03-11 15:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 10:34 Using pg_upgrade to change from 32 to 64 bit. Paul Smith <paul@pscs.co.uk>
2021-03-11 14:57 ` Bruce Momjian <bruce@momjian.us>
2021-03-11 15:39 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox