Re: Support for 8-byte TOAST values, round two

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Greg Burd <greg(at)burd(dot)me>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support for 8-byte TOAST values, round two
Date: 2026-09-15 07:08:04
Message-ID: aqju1K96ex28yz2X@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 14, 2026 at 12:26:54PM -0700, Bharath Rupireddy wrote:
> v18-0001-Add-support-for-oid8-TOAST-values.patch: It looks good to me.
> v18-0002-Add-battery-of-tests-related-oid8.patch: It looks good to me.
> v18-0003-Add-support-for-TOAST-pointers-as-oid8.patch: It looks good to me.

Thanks. I have spent the day processing all these free, and finally
applied the set.

One thing that neither you nor Greg pointed out is a disturbance I
have found in amcheck. The code relied on a vartag to decide the max
chunk size of a TOAST blob:
+ max_chunk_size = ta->tag == VARTAG_ONDISK_OID8
+ ? TOAST_OID8_MAX_CHUNK_SIZE
+ : TOAST_OID_MAX_CHUNK_SIZE;

But that's wrong, because we want to check the sanity of the toast
pointer itself. If the tag is corrupted for a reason or another, we
could finish with an incorrect check. The correct way to handle this
case is to retrieve the max chunk based on the type of chunk_id as
defined in the cached toast_rel information, and also cross-check that
the vartag matches with the chunk_id type.

While on it, I have noticed a small mistake after commit 6e58d6356fcb
in check_toasted_attribute(): a return is missing after the first
report_toast_corruption(). Will adjust that..

> v18-0005-Add-check-for-2-32-oid8-chunk-values-across-the-.patch: It
> looks good to me with a nit. It took me a while to figure out where
> the f1 column is coming from, so worth adding a comment here (it is
> the bytea column of the toasttest_oid8 table defined in
> src/test/regress/sql/strings.sql).

v18-0004 and v18-0015 are not there yet.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-09-15 07:15:02 Locking and property graphs
Previous Message shveta malik 2026-09-15 06:53:15 Re: Proposal: Conflict log history table for Logical Replication