Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUq74-003BTo-24 for pgsql-general@arkaria.postgresql.org; Mon, 06 Jan 2025 16:37:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tUq73-00A90o-DR for pgsql-general@arkaria.postgresql.org; Mon, 06 Jan 2025 16:37:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUq73-00A90f-1z for pgsql-general@lists.postgresql.org; Mon, 06 Jan 2025 16:37:56 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tUq70-000BCJ-1f for pgsql-general@lists.postgresql.org; Mon, 06 Jan 2025 16:37:55 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3ebc678b5c9so8031726b6e.3 for ; Mon, 06 Jan 2025 08:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736181474; x=1736786274; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VjbYMbUgW68noVFn16Vatg5E6TYXan+qT/BgkXpnvQg=; b=dinCOIF7tgcGVRpldB0xxoH2q+t0VBbeqL0LKcsyi08BeSXKX3AEDLZtHkX7AwVRl3 iTQB9tmOdrbQ772je1WAE3ljnKmscaaJuJDSFeb3t3yJel54lSoJWJmXUxL9oncMaAwX MylFotAcV0NdpvYpZiAIfo40JDMTdt89TKE39udU/fY7rkLjLcvZhtJIPcSPpymLQCb3 wPYePXJi8ojBvE0Cr8rylGbiGzYl8Mq9OiRjy4CkIKoqr+YWHcMEJKcp8JFBZI8EccXI N/V3o1X0D4nxViXJ/EWWsgy0ayk+xtkehUWHY5GcIRCtHljF1cYyf2TifXwzd6Cg5Xra pEqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181474; x=1736786274; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VjbYMbUgW68noVFn16Vatg5E6TYXan+qT/BgkXpnvQg=; b=MGIKrwoa/jEQb2l8kKTdU+QVLwut5lADnx0WjtlPm/zxwduBvC4qUcXL2gWbofVTqj cJvaXDYt1o8xtL6jwJIFrMrcmYRO+EcmMafkYkVdyl73j5+Zyr6Tbg2IeDegTC7XWN3a t9QnYI4k0JxiF8ACsgAoMfCni/MTvhS3ZFNwaiyB34/HLImbAEZwFxFYqUpFI87hC/sa 487Hk1KpEy9vXvWAEnRdC9XWa0n6z40ufbJwsn040xeTJ7FljlzO1btOQFPj/IMdm/uH ehAp01VkiCCddk/OdmkbuUech7Y2f9Gn3i4SPrLRCQ2lceK7NXNOGOtcuk6okpqW4wBH qTbQ== X-Gm-Message-State: AOJu0Yyp3ge1YW4FyCr5ITZciZfJB9fBHM1c1tJ8KXS+E55U4Wq3a4fX EhqbCVap/ZJo552OCYxTaHffHrCOqEviiylR/GMjTdYs/7wRgrC2HtKYUEKx1BGYSyhmGi0kKQy yohg+7xOF/oaQBKDO6MdRdizp8KE= X-Gm-Gg: ASbGnctOBQ27soltpDmFfdK1HLLJmYQN3/L9F3fNatg4BDrJoYBHg/PoAUeW6chq9wp cMNL0jvEkBm7kPFkoQtNknckMnqX3Bzahd+5yCg== X-Google-Smtp-Source: AGHT+IFrORbynhcpdXrMH8GK18R7cifFiUZy7/3OaB9lL9oDpRSUsHl/KA3ZJlYzSjSNkXmeTkp4WKITkKRzM+rtasI= X-Received: by 2002:a05:6808:3447:b0:3ea:6533:f19d with SMTP id 5614622812f47-3ed89091031mr33040048b6e.30.1736181473886; Mon, 06 Jan 2025 08:37:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Mon, 6 Jan 2025 09:37:20 -0700 Message-ID: Subject: Re: Query related to Logical Replication using test_decoding and unchanged-toast-datum To: Kiran K V Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000044b8d062b0c4040" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000044b8d062b0c4040 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 6, 2025 at 7:21=E2=80=AFAM Kiran K V w= rote: > could you please tell me whether PostgreSQL will truly log these values t= o > 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-ON= DISK "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. --000000000000044b8d062b0c4040 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jan 6, 2025 at 7:21=E2=80=AFAM Kiran K V <kirankv.1982@gmail.com> wrote:<= /span>
could you p= lease 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 u= nchanged?


Not qui= te 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 t= able 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 un= compressed data length), physical stored size (different if compression was= applied), and the compression method used, if any. Allowing for the varlen= a header bytes, the total size of an on-disk TOAST pointer datum is therefo= re 18 bytes regardless of the actual size of the represented value."

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

=
David J.

--000000000000044b8d062b0c4040--