pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: test_decoding: Don't print virtual generated columns.
Date: Tue, 18 Aug 2026 20:57:40 +0000
Message-ID: <E1wwQsN-000000016zx-0qvO@gemulon.postgresql.org> (raw)

test_decoding: Don't print virtual generated columns.

Virtual generated columns are stored in tuples as null values, so
heap_getattr() in tuple_to_stringinfo() always returns null for them.
test_decoding printed such a column as null, which is
indistinguishable from a column that genuinely holds null.

This commit skips virtual generated columns in tuple_to_stringinfo(),
the only place that prints a tuple. Stored generated columns continue
to be printed, since their values do live in the heap tuple.

This is a behavior change rather than a bug fix, and it changes
test_decoding's output for tables that have virtual generated columns,
which could affect consumers that parse it. Therefore it is not
back-patched.

Author: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
Co-authored-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CAHg+QDfTh3UbB-Ed--o2Bd=SBDJoEiG-qp3C0+ETDibF63y=dw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/755f7e2c921f16e6bc09bdc8d286c495b2cee93b

Modified Files
--------------
contrib/test_decoding/expected/ddl.out | 18 ++++++++++++++++++
contrib/test_decoding/sql/ddl.sql      | 12 ++++++++++++
contrib/test_decoding/test_decoding.c  | 10 ++++++++++
3 files changed, 40 insertions(+)



Message-ID: <E1wwQsN-000000016zx-0qvO@gemulon.postgresql.org>
Permalink:  ../E1wwQsN-000000016zx-0qvO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wwQsN-000000016zx-0qvO@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: msawada@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: test_decoding: Don't print virtual generated columns.
  In-Reply-To: <E1wwQsN-000000016zx-0qvO@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox