Re: Query related to Logical Replication using test_decoding and unchanged-toast-datum - Mailing list pgsql-general

From David G. Johnston
Subject Re: Query related to Logical Replication using test_decoding and unchanged-toast-datum
Date
Msg-id CAKFQuwYYpyv_qqLXLKPqTKeY74bUR9XMXzAgUh=OPxYLqn=Ssw@mail.gmail.com
Whole thread Raw
In response to Query related to Logical Replication using test_decoding and unchanged-toast-datum  (Kiran K V <kirankv.1982@gmail.com>)
List pgsql-general
On Mon, Jan 6, 2025 at 7:21 AM Kiran K V <kirankv.1982@gmail.com> 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:


"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.

pgsql-general by date:

Previous
From: Kiran K V
Date:
Subject: Query related to Logical Replication using test_decoding and unchanged-toast-datum
Next
From: Adrian Klaver
Date:
Subject: Re: Questions about the Debian Package version of pgAdmin