public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Kiran K V <[email protected]>
Cc: [email protected]
Subject: Re: Query related to Logical Replication using test_decoding and unchanged-toast-datum
Date: Mon, 6 Jan 2025 09:37:20 -0700
Message-ID: <CAKFQuwYYpyv_qqLXLKPqTKeY74bUR9XMXzAgUh=OPxYLqn=Ssw@mail.gmail.com> (raw)
In-Reply-To: <CAGv0ivrBc=X6iaWA9Fng7u8D5BbM6EbcNy-4xF0DGFrAV+c2zw@mail.gmail.com>
References: <CAGv0ivrBc=X6iaWA9Fng7u8D5BbM6EbcNy-4xF0DGFrAV+c2zw@mail.gmail.com>

On Mon, Jan 6, 2025 at 7:21 AM Kiran K V <[email protected]> wrote:

> could you please tell me whether PostgreSQL will truly log these values to
> WAL or not ? If not, what will be entered into WAL for the JSON column if
> it remains unchanged?
>
>
Not quite sure what you are looking for but:

https://www.postgresql.org/docs/current/storage-toast.html#STORAGE-TOAST-ONDISK

"A pointer datum representing an out-of-line on-disk TOASTed value
therefore needs to store the OID of the TOAST table in which to look and
the OID of the specific value (its chunk_id). For convenience, pointer
datums also store the logical datum size (original uncompressed data
length), physical stored size (different if compression was applied), and
the compression method used, if any. Allowing for the varlena header bytes,
the total size of an on-disk TOAST pointer datum is therefore 18 bytes
regardless of the actual size of the represented value."

So the WAL of the main table data will contain 18bytes of data for that
column.  If the toast data really hasn't changed during the period in
question the WAL will not contain any data for the toast relation since no
changes to it were made.

David J.


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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Query related to Logical Replication using test_decoding and unchanged-toast-datum
  In-Reply-To: <CAKFQuwYYpyv_qqLXLKPqTKeY74bUR9XMXzAgUh=OPxYLqn=Ssw@mail.gmail.com>

* 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