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: John Naylor <johncnaylorls(at)gmail(dot)com>, 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-22 22:35:00
Message-ID: CALj2ACW1+23ikei=sB3EMV44EOE-vbbMA_dSXSOkOhj9QNVuUQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Sep 22, 2026 at 12:58 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> - values are large enough to require it. Only an 18-byte pointer must remain
> - inside the tuple in the table's heap. For shorter length variable-length
> - fields, either a 4-byte or 1-byte field header is used and the value is
> - stored inside the heap tuple.
> + values are large enough to require it. Only an 18-byte or 22-byte pointer
> + must remain inside the tuple in the table's heap, for a TOAST table using an
> + OID or an OID8 respectively. For shorter length variable-length fields,
> + either a 4-byte or 1-byte field header is used and the value is stored
> + inside the heap tuple.
>
> How about the following instead for this part, slightly tweaked:
> "Only an 18-byte or 22-byte TOAST pointer must remain inside the tuple
> in the table's heap, depending on whether the TOAST table uses OID or
> OID8 values, respectively. For shorter length variable-length fields,
> either a 4-byte or 1-byte field header is used and the value is stored
> inside the heap tuple."
>
> Typically, this is only an issue for tables containing many terabytes
> of data; partitioning is a possible workaround.
> + A TOAST table using an OID8 does not have this issue, as it can store up
> + to 2^64 out-of-line values and new identifiers are assigned without
> + searching for a free one; see <xref linkend="reloption-toast-value-type"/>.
>
> And here, a bit cleaned up:
> "A TOAST table using OID8 values does not have this issue as it can
> store up to 2^64 out-of-line values. New identifiers are assigned
> without searching for a free one.
> See <xref linkend="reloption-toast-value-type"/> for details."

Agreed. Using OID/OID8 values and breaking up the sentences reads
better. Please find the attached v2 patch.

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

Attachment Content-Type Size
v2-0001-doc-Mention-oid8-TOAST-values-in-the-limits-appen.patch application/octet-stream 2.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2026-09-22 22:49:38 Re: proposal: add new dblink function, dblink_wait_for_query()
Previous Message Zsolt Parragi 2026-09-22 22:18:08 Re: SSI: ON CONFLICT DO SELECT takes no predicate lock on the returned row