agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor assembly of external on-disk TOAST pointers
Date: Mon, 28 Sep 2026 03:12:54 +0000
Message-ID: <E1xB1nS-00000001Xro-0eAe@gemulon.postgresql.org> (raw)

Refactor assembly of external on-disk TOAST pointers

toast_save_datum() ended with two copies of the same three steps, one
each external on-disk TOAST pointer: allocate a datum, set its tag, then
copy the contents from a varatt_external_oid or a varatt_external_oid8
into it.

These steps are moved into a new helper function, toast_pointer_build(),
which takes the tag and a pointer to the struct and derives everything
else from the tag.  For now, only two varatt_external_* exist for
external on-disk TOAST pointers.  Some more are under discussion, where
this refactoring shows some benefits in the shape of less duplication.

There should be no behavior change.

Author: Nikhil Kumar Veldanda <veldanda.nikhilkumar17@gmail.com>
Discussion: https://postgr.es/m/CAFAfj_FeJQZrKyVn7ur0aJx8iz8SR14NheVJNyc8JNoqtMX+og@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/74f7f684d6ed1fd3c3aee4d868f2e6d1da0ec93b

Modified Files
--------------
src/backend/access/common/toast_internals.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)



Message-ID: <E1xB1nS-00000001Xro-0eAe@gemulon.postgresql.org>
Permalink:  ../E1xB1nS-00000001Xro-0eAe@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xB1nS-00000001Xro-0eAe@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor assembly of external on-disk TOAST pointers
  In-Reply-To: <E1xB1nS-00000001Xro-0eAe@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox