Re: Making type Datum be 8 bytes everywhere

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(at)vondra(dot)me>
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:33:11
Message-ID: 358105.1796509991@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-12-05 22:38:38 Re: Making type Datum be 8 bytes everywhere
Previous Message surya poondla 2026-12-05 22:06:56 Re: pg_rewind reports "no rewind required" due to stale minRecoveryPoint