Re: Gradual migration from integer to bigint? - Mailing list pgsql-general

From Tom Lane
Subject Re: Gradual migration from integer to bigint?
Date
Msg-id 1635509.1696131447@sss.pgh.pa.us
Whole thread Raw
In response to Re: Gradual migration from integer to bigint?  (James Healy <james@yob.id.au>)
Responses Re: Gradual migration from integer to bigint?  (Ron <ronljohnsonjr@gmail.com>)
Re: Gradual migration from integer to bigint?  (James Healy <james@yob.id.au>)
Re: Gradual migration from integer to bigint?  (Ann Harrison <ann@qbeast.net>)
Re: Gradual migration from integer to bigint?  (Nick Cleaton <nick@cleaton.net>)
List pgsql-general
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



pgsql-general by date:

Previous
From: James Healy
Date:
Subject: Re: Gradual migration from integer to bigint?
Next
From: Ron
Date:
Subject: Re: Gradual migration from integer to bigint?