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

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
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-10 17:06:07
Message-ID: CALj2ACWEY0HHREE5Dn9Waa33coj-SwxPRkEtW4A=nCSzN8UrAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Sep 10, 2026 at 12:52 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Sep 10, 2026 at 08:18:57AM +0900, Michael Paquier wrote:
> > Hmm. Okay. I'll think about something here.
>
> Attached is a rebased v16 following cb298616463d. The patch set has
> been slightly re-organized, with the pieces that seem worth
> introducing first on top of the rest:
> - 0001 for binary upgrades.

0001 looks good to me. I reviewed v15 previously and there is no change in v16.

> - 0002 for the reloption toast_value_type

0002 looks good to me. The note in the docs about rewrites and pg_dump
and the tests are good additions. My previous comments on
parenthesizing the default arg and the typo in the docs are fixed.

> - 0003 for adding more Oid8 in the TOAST APIs compared to Oid.

0003 looks good to me. There is no change in this from the v15 patch,
and for the reorderbuffer.c change, I microbenchmarked uint32_hash and
tag_hash, and use of tag_hash seems fine to me.

> - 0004 for pg_column_toast_chunk_id() switched to Oid8

0004 looks good to me. I reviewed v15 previously and there is no change in v16.

> - 0005 for adding toast_value_type=oid8, with all the TOAST changes
> not related to the new vartag.

0005 looks good to me with the following comment. With this, one can
create a TOAST table with OID8 chunk_id but will only get OID4
behavior. Calling that out in the commit message seems fine to me, but
let us try to get this patch and 0007 (adding vartag_external) closer
or together. Also, the mention about the price one has to pay for
using OID8 (four extra bytes per out-of-line pointer) looks like it
addresses Greg's point on the max number of TOAST-able columns.

1/ An error would be better here when an unexpected TOAST typeid is
detected for some reason.
+ else
+ Assert(false);

> - 0006 is the battery of tests for all the cases found during
> development, grouped together: core things, amcheck, test_decoding..

0006 looks good to me. Tests cover most of the cases. Is it good to
cover the pg_dump and pg_restore case (OID4 to OID8 after changing the
reloption) as well, perhaps as a follow-up patch?

> - 0007 adds the new vartag_external.
>
> - 0008 is the tweak for toast_tuple_find_biggest_attribute(), which
> should perhaps be merged with 0007.

I will soon get to reviewing these two patches.

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2026-09-10 17:09:00 Re: Rename PqMsg_Progress to PqMsg_ParallelWorkerProgress
Previous Message Maksim.Melnikov 2026-09-10 16:49:55 Race between prepared transaction commit and checkpointer