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.96) (envelope-from ) id 1wK89F-000dIo-1H for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 05:16:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wK89E-00ADwQ-07 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 05:16:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wK89D-00ADwI-2F for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2026 05:16:43 +0000 Received: from mail-ua1-x930.google.com ([2607:f8b0:4864:20::930]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wK89B-00000000Zyo-2ev6 for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2026 05:16:43 +0000 Received: by mail-ua1-x930.google.com with SMTP id a1e0cc1a2514c-9568159ee07so3128188241.1 for ; Mon, 04 May 2026 22:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777958199; cv=none; d=google.com; s=arc-20240605; b=YvSCEWnBH3/X/m8IGYzEX2yMxVbB1xmLnwEChYRpD0YybLVY0/tZzsT8t5Ra94U8n+ P6qgpOnfSZRSx0wONknxK/scmEWPxtS0oq+dw4pFgujZgDkGKMLH6yD7nwx0f3KhLhzm RedE9g/xUrL2FXV19H3jQ8qpSoZkNHEN0gQi524AgNI+4xtIb3jpqHz2BZbb5pVqP6LE S9Svr9vyOShHSh4GiZVBG7Qk0QCiqL4UmU9B9AjxxFKsf77t2lIVbuDB2HbeJbSnYPNa gzXnMU9h0Txi6hWb1Ckf6BDh3HRjWJxQqICTk4Be4VTXz++wW0RJOwefF62UdzVWm1q6 43tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=nDCc9Oakh3RCo/GWYyw4HJb7wL7qlbIK0G+Une9VQ7s=; fh=fHPnWoN9hdVYJX0ngaQZoeyW5KGZKe7keNV4Qz9mQc0=; b=iosQVKyt180hBnC6YoNFQ3IkSIQMFvA4mhiX8tPntXzkkaARJX4TBHeFKkf9UhzHpV TSju2RnAA0u/3CCx+PFPvPuddvlOykRJsMunADDAHrGZIdllL/xKLcqi9jzY7sImJaYL vtn/2nOjuwZvxlkRDkKi+F1Gb9LS42f8thJcFczncLyujD2a6PRoe3NdeDqYSmL1/2Lj yniDESfO1q4E2T4dSwicJMrkVBsg4H4lZPL3kI3tiNllisWZ/ylaHVbyg9mGWze0bCGe M68txE/G8kCJh08q6etL9b+uhFnmsPZqCYGjO6frwE+oDgp9Rh+LVpRVwXfNbGRAw9pH 3VQg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777958199; x=1778562999; 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=nDCc9Oakh3RCo/GWYyw4HJb7wL7qlbIK0G+Une9VQ7s=; b=nixVV80v6dGrG6c7wvRIdQJObwSmKXt/AgXM0bRG1ytikL6v/RrdgZlM/OHy+TS0l2 G3VJBxUOl4GH2rd8cF6VMvnCqzRi42E9mOhzSUY55XR9kw0hOEQD+uek3ooAzf3W4M7h 0GXroLQ2+4Tl77/qFVlD5sG8lvebv7EWZYpAxeWfPqMADr5sfuJDhgAGO622S8C240Pq YD689hmmP+OQ679IwfrAVCdftUTOa1k7Dva6oyOc2az4/8F40AMm+XWDvFbTY6KnNRKL d/7gw/i7j1uRXAIL9CynTFYv9azthVG6qOXax6FDA56ig34OuICVSmoHa9Vr5578GCcP YLGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777958199; x=1778562999; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nDCc9Oakh3RCo/GWYyw4HJb7wL7qlbIK0G+Une9VQ7s=; b=BTU9OpQteXDHyQQ0pEFDDG7XrIRMBFJMwn1SE4BBtlYOGWqJ6Ah1euaJFCu4mXSRF3 5nBXRC+9zOWRrZ/aDZi1wdt0xWXyIxmX3ng0KVDtupWBC5xF36IxP4D9VDr6Kl4Ye+fO NT6LhX2NZy0vrG6+W7B8JPN9zTOLaWV9ck7q2xmqWgOMfLW51zM0UcprbQpvVMXVEcrG OApKxLjF4jqurYaYlqyWmltR0NSan9pDbDzjHd2n5XPS14txyCwJgsxXi2B3SIj1uE/e uHrKAV2ytJXNDQxUYgBd9ktY2I7ToALYoM8H5FJLfIgSOWLAd9S/V5DkXOmzssCsOksd DKgQ== X-Gm-Message-State: AOJu0Yzfr2iD08MwPdruCCvpxJkpMM+POZ5HVXNHGblGDtew3bHVVyM9 NNGMw+xRfsO6qe6ZeREr8f+KSajZuJdyb+xcK0kS7TLjKKJnRXPJGOGaGhSjmcLzYtDCHhJqf2d 7PF+KQ93Mhsr6v4wpw8nCeH48CE/soAU= X-Gm-Gg: AeBDiesZtIWm01YPilqC+2IyhAKoV16upTNrUSDI15FDAlItRAEz1zOaRsoOsLG09VV GxzB8c7xKfakggNoEMYL+OD1dyrRB/fAaa+jqk10qF47jfuVLAh3xKLtmPhCa8qj7ozQtFWixe6 /UQ/eK5I0lQphqemj97rYm0zx1hT8WbXnAsFTrvB7n+eiot20lsLqCf4SBavYSNtMbqrvaTBBHo SYz0cfsIXNkablJO/X6aPpBnLmdcZO/bBOWdFGo1M/0rqyVPUYzHeRnR2NlE31skI9AoAs6nfiH h8bCDBG5Fbu0kKaaCw== X-Received: by 2002:a05:6102:4b0c:b0:604:f29d:84be with SMTP id ada2fe7eead31-62d84a67460mr7203954137.3.1777958198617; Mon, 04 May 2026 22:16:38 -0700 (PDT) MIME-Version: 1.0 References: <48110911-4707-4945-8d19-6afc9829fd1f@app.fastmail.com> In-Reply-To: <48110911-4707-4945-8d19-6afc9829fd1f@app.fastmail.com> From: SATYANARAYANA NARLAPURAM Date: Mon, 4 May 2026 22:16:26 -0700 X-Gm-Features: AVHnY4KRRFLw1o2svsIon0G3Pu5ORRy6BzpMDqs6RE8_w38KPdOWu3sCEdZBvLY Message-ID: Subject: Re: [Patch] Omit virtual generated columns from test_decoding output To: Euler Taveira Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000daabe006510b267c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000daabe006510b267c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Mon, May 4, 2026 at 8:09=E2=80=AFPM Euler Taveira wr= ote: > On Mon, May 4, 2026, at 10:11 PM, SATYANARAYANA NARLAPURAM wrote: > > > > Virtual generated columns are not stored on disk, so heap_getattr() in > > tuple_to_stringinfo() always returned NULL for them, producing > > misleading output such as > > > > table public.t: INSERT: a[integer]:1 b[integer]:10 c[integer]:null > > > > even though the user could observe a non-null value via SELECT. Stored > > generated columns continue to be emitted as before because their values > > do live in the heap tuple. > > > > I wouldn't say misleading but expected. Logical decoding relies on WAL an= d > virtual generated columns are not stored in the WAL. > > > This matches the pgoutput's logicalrep_should_publish_column() > > which never publishes virtual generated columns. Added a regression tes= t. > > Please find the patch attached. > > > > There is no guarantee that test_decoding should match the pgoutput. Agreed, not trying to keep them in sync but giving as a reference. > I agree that > test_decoding shouldn't output virtual generated columns. The problem is > that it > already does it. I'm afraid that removing it should break existing > applications. > (I heard that some solutions rely on test_decoding for CDC.) Should we > change it > as you proposed or add an option to put it back to keep the old behavior? > It is emitting null, I am not sure if it is meaningful for the consumers to consume this or have taken dependency on this. Adding an extra option isn't an overkill for this? I am open to this idea if others feel the same. > I didn't review your patch but I noticed that there is a new test file fo= r > this > change. There are some concerns about the total test execution time. Do y= ou > really need to include this test? If so, should you combine it with an > existing > test file? Fair concern, I moved the tests to ddl.sql. Please find the attached v2 patch. Thanks, Satya --000000000000daabe006510b267c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Mon, May 4, 2= 026 at 8:09=E2=80=AFPM Euler Taveira <euler@eulerto.com> wrote:
On Mon, May 4, 2026, at 10:11 PM, SATYANARAYANA NARLAPU= RAM wrote:
>
> Virtual generated columns are not stored on disk, so heap_getattr() in=
> tuple_to_stringinfo() always returned NULL for them, producing
> misleading output such as
>
>=C2=A0 =C2=A0table public.t: INSERT: a[integer]:1 b[integer]:10 c[integ= er]:null
>
> even though the user could observe a non-null value via SELECT.=C2=A0 = Stored
> generated columns continue to be emitted as before because their value= s
> do live in the heap tuple.
>

I wouldn't say misleading but expected. Logical decoding relies on WAL = and
virtual generated columns are not stored in the WAL.

> This matches the pgoutput's logicalrep_should_publish_column()
> which never publishes virtual generated columns. Added a regression te= st.
> Please find the patch attached.
>

There is no guarantee that test_decoding should match the pgoutput.

Agreed, not trying to keep them in sync but givin= g as a reference.

=C2=A0
I agree that
test_decoding shouldn't output virtual generated columns. The problem i= s that it
already does it. I'm afraid that removing it should break existing appl= ications.
(I heard that some solutions rely on test_decoding for CDC.) Should we chan= ge it
as you proposed or add an option to put it back to keep the old behavior?

It is emitting null, I am not sure if it= is meaningful for the consumers to consume this or
have taken de= pendency on this. Adding an extra option isn't an overkill for this? I = am open=C2=A0
to this idea if others feel the same.
=C2=A0
I didn't review your patch but I noticed that there is a new test file = for this
change. There are some concerns about the total test execution time. Do you=
really need to include this test? If so, should you combine it with an exis= ting
test file?

Fair concern, I moved the tests = to=C2=A0ddl.sql.=C2=A0 Please find the attached v2 patch.

Thanks,
Satya
--000000000000daabe006510b267c--