Re: Making type Datum be 8 bytes everywhere

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Making type Datum be 8 bytes everywhere
Date: 2026-12-05 22:38:38
Message-ID: 2bf944a0-692b-4638-8ffd-7179467f674e@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/5/26 23:33, Tom Lane wrote:
> Tomas Vondra <tomas(at)vondra(dot)me> writes:
>> The exact failure is this:
>
>> pg_restore: while PROCESSING TOC:
>> pg_restore: from TOC entry 7819; 2605 35240 CAST CAST (bigint AS
>> "public"."int8alias1") (no owner)
>> pg_restore: error: could not execute query: ERROR: source and target
>> data types are not physically compatible
>> Command was: CREATE CAST (bigint AS "public"."int8alias1") WITHOUT FUNCTION;
>
>> After a bit of digging, I think it's due to this change (2a600a93c7b),
>> and I'm not sure it's expected / intentional.
>
> Yeah, I think you're right. The type is still the same as far as
> typlen and typalign go, but not typbyval. So it's actually compatible
> on-disk, but we can't allow a binary-compatible cast because the Datum
> representation is different.
>
>> I'm not sure what we can do about it, at this point. The number of
>> people running 32-bit systems with custom data types and casts from
>> built-in types seems pretty small. But who knows?
>
> I agree, no good way to do anything about it now, and given the lack
> of field complaints it's not worth moving heaven and earth for.
>

True, although this only affects upgrades from 18 -> 19, and 19 is out
only for a couple weeks. But I still doubt we'll see reports about
32-bit upgrades. If we're wrong, we may have to figure out something then.

> What we can do to stop the test failures is to make
> adjust_database_contents() drop this cast (and any dependent objects).
>

+1, will you take care of it, or should I?

thanks

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-12-05 22:40:37 Re: Making type Datum be 8 bytes everywhere
Previous Message Tom Lane 2026-12-05 22:33:11 Re: Making type Datum be 8 bytes everywhere