pgsql: Add support for TOAST chunk_id type in binary upgrades

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add support for TOAST chunk_id type in binary upgrades
Date: 2026-09-11 01:55:40
Message-ID: E1x4qUN-00000004N7B-3J3e@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add support for TOAST chunk_id type in binary upgrades

This commit adds a new SQL function able to set the type of a chunk_id
attribute for a TOAST table across binary upgrades. The value is set
when the creation of a TOAST table is required across upgrades, in the
same fashion as the TOAST relation's oid and relfilenode.

Note that this piece currently works only with a TOAST table's chunk_id
set at OIDOID, because it is currently the only type of on-disk external
TOAST pointer supported. This change is required for a follow-up
feature that aims to introduce support for 8-byte OIDs in external TOAST
pointers.

Taking care of this issue separately is less code churn for the next
changes, and perhaps some of the surrounding discussions with support
for different types of external on-disk TOAST pointers will find this
new facility useful.

Bump catalog version.

Author: Michael Paquier <michael(at)paquier(dot)xyz>
Reviewed-by: Greg Burd <greg(at)burd(dot)me>
Reviewed-by: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Reviewed-by: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Discussion: https://postgr.es/m/af19kUjwjhaoUTLn@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/34fcd735f1ebd5efba8653cdbfbfd076b081660a

Modified Files
--------------
src/backend/catalog/heap.c | 1 +
src/backend/catalog/toasting.c | 20 +++++++++++++++++++-
src/backend/utils/adt/pg_upgrade_support.c | 11 +++++++++++
src/bin/pg_dump/pg_dump.c | 14 +++++++++++---
src/include/catalog/binary_upgrade.h | 1 +
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 5 +++++
.../spgist_name_ops/expected/spgist_name_ops.out | 6 ++++--
8 files changed, 53 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-09-11 02:05:22 pgsql: Add static assertion to track the no-padding rule of varatt_exte
Previous Message Jeff Davis 2026-09-11 01:14:02 pgsql: Revert 87b2968df0 and 0a90df58cf.