pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add all required calls to TupleDescFinalize()
Date: Sun, 15 Mar 2026 22:50:34 +0000
Message-ID: <E1w1uI5-000LSu-1g@gemulon.postgresql.org> (raw)

Add all required calls to TupleDescFinalize()

As of this commit all TupleDescs must have TupleDescFinalize() called on
them once the TupleDesc is set up and before BlessTupleDesc() is called.

In this commit, TupleDescFinalize() does nothing. This change has only
been separated out from the commit that properly implements this function
to make the change more obvious.  Any extension which makes its own
TupleDesc will need to be modified to call the new function.

The follow-up commit which properly implements TupleDescFinalize() will
cause any code which forgets to do this to fail in assert-enabled builds in
BlessTupleDesc().  It may still be worth mentioning this change in the
release notes so that extension authors update their code.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/CAApHDvpoFjaj3%2Bw_jD5uPnGazaw41A71tVJokLDJg2zfcigpMQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/503620311e3fc127708b00d4cd7eff6fd3154753

Modified Files
--------------
contrib/dblink/dblink.c                                     |  4 ++++
contrib/pg_buffercache/pg_buffercache_pages.c               |  2 ++
contrib/pg_visibility/pg_visibility.c                       |  2 ++
src/backend/access/brin/brin_tuple.c                        |  1 +
src/backend/access/common/tupdesc.c                         | 13 +++++++++++++
src/backend/access/gin/ginutil.c                            |  1 +
src/backend/access/gist/gistscan.c                          |  1 +
src/backend/access/spgist/spgutils.c                        |  1 +
src/backend/access/transam/twophase.c                       |  1 +
src/backend/access/transam/xlogfuncs.c                      |  1 +
src/backend/backup/basebackup_copy.c                        |  3 +++
src/backend/catalog/index.c                                 |  2 ++
src/backend/catalog/pg_publication.c                        |  1 +
src/backend/catalog/toasting.c                              |  6 ++++++
src/backend/commands/explain.c                              |  1 +
src/backend/commands/functioncmds.c                         |  1 +
src/backend/commands/sequence.c                             |  1 +
src/backend/commands/tablecmds.c                            |  4 ++++
src/backend/commands/wait.c                                 |  1 +
src/backend/executor/execSRF.c                              |  2 ++
src/backend/executor/execTuples.c                           |  4 ++++
src/backend/executor/nodeFunctionscan.c                     |  2 ++
src/backend/parser/parse_relation.c                         |  4 +++-
src/backend/parser/parse_target.c                           |  2 ++
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c |  1 +
src/backend/replication/walsender.c                         |  5 +++++
src/backend/utils/adt/acl.c                                 |  1 +
src/backend/utils/adt/genfile.c                             |  1 +
src/backend/utils/adt/lockfuncs.c                           |  1 +
src/backend/utils/adt/orderedsetaggs.c                      |  1 +
src/backend/utils/adt/pgstatfuncs.c                         |  5 +++++
src/backend/utils/adt/tsvector_op.c                         |  1 +
src/backend/utils/cache/relcache.c                          |  8 ++++++++
src/backend/utils/fmgr/funcapi.c                            |  6 ++++++
src/backend/utils/misc/guc_funcs.c                          |  5 +++++
src/include/access/tupdesc.h                                |  1 +
src/pl/plpgsql/src/pl_comp.c                                |  2 ++
.../modules/test_custom_stats/test_custom_fixed_stats.c     |  1 +
src/test/modules/test_predtest/test_predtest.c              |  1 +
39 files changed, 100 insertions(+), 1 deletion(-)



Message-ID: <E1w1uI5-000LSu-1g@gemulon.postgresql.org>
Permalink:  ../E1w1uI5-000LSu-1g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w1uI5-000LSu-1g@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: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add all required calls to TupleDescFinalize()
  In-Reply-To: <E1w1uI5-000LSu-1g@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