From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Healy <james@yob.id.au>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Gradual migration from integer to bigint?
Date: Sat, 30 Sep 2023 23:37:27 -0400
Message-ID: <1635509.1696131447@sss.pgh.pa.us> (raw)
In-Reply-To: <CAE4DO2QAKxNnaPO6FepV_C1B9MV3ahWADG=V+j3wprqPcxa0rg@mail.gmail.com>
References: <CAE4DO2THV1_70g5nRWDZiJOHPP7LnSHfYGzAdiTzFiu4L+o5iA@mail.gmail.com>
<ZRhcRnnUrGsB3p7K@momjian.us>
<CAE4DO2QAKxNnaPO6FepV_C1B9MV3ahWADG=V+j3wprqPcxa0rg@mail.gmail.com>
James Healy <james@yob.id.au> writes:
> However it doesn't really address the question of a gradual migration
> process that can read 32bit ints but insert/update as 64bit bigints. I
> remain curious about whether the postgres architecture just makes that
> implausible, or if it could be done and just hasn't because the
> options for a more manual migration are Good Enough.
I think what you're asking for is a scheme whereby some rows in a
table have datatype X in a particular column while other rows in
the very same physical table have datatype Y in the same column.
That is not happening, because there'd be no way to tell which
case applies to any particular row.
You could fantasize about labeling individual rows somehow, but
it's mere fantasy because there's noplace to put such labels.
To the limited extent that we can find spare space in the
existing page layout, there are far better use-cases (see
nearby discussions about 64-bit XIDs, for example). And nobody
is going to advocate breaking on-disk compatibility for this,
especially not a break that adds more per-row overhead.
So really the only way forward for this would be to provide more
automation for the existing conversion processes involving table
rewrites. That's possible perhaps, but it doesn't really sound
compelling enough to justify a lot of work.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, james@yob.id.au, bruce@momjian.us
Subject: Re: Gradual migration from integer to bigint?
In-Reply-To: <1635509.1696131447@sss.pgh.pa.us>
References: <CAE4DO2THV1_70g5nRWDZiJOHPP7LnSHfYGzAdiTzFiu4L+o5iA@mail.gmail.com> <ZRhcRnnUrGsB3p7K@momjian.us> <CAE4DO2QAKxNnaPO6FepV_C1B9MV3ahWADG=V+j3wprqPcxa0rg@mail.gmail.com> <1635509.1696131447@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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