pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Move per-attribute version to pg_attribute.attversion
Date: Mon, 09 Nov 2026 14:21:52 +0000
Message-ID: <E1xQQFs-000000003Ov-0Yf2@gemulon.postgresql.org> (raw)

Move per-attribute version to pg_attribute.attversion

In the back-branches the attribute version could obviously not be stored
in a new pg_attribute column. Nor could we add a tuple descriptor's
aggregate version to TupleDesc and had to resort to some ugliness
instead.

Do it the breaking way now; the reduced per-row overhead and improved
notational clarity make it a clear win.

Due to not needing the TupleDesc workarounds anymore,
TupleDescCopySize() is just the size of the descriptor again. Remove
TupleDescSize() and TupleDescCopy(), so that callers have to use
TupleDescCopySize() / TupleDescCopySized(), which verify the size of the
destination.

Storing an LSN in pg_attribute required teaching bootstrap & genbki
about LSNs.

Note that the mention of the pg_ prefix in attoptions has not been
removed, for the benefit of tool writers that might just read master's
documentation (it also seems not bad to just have that reserved
namespace).

This obviously can only be applied on master.

Bumps catversion.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Security: CVE-2026-6460

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6a3da13d376f5950fd105eedddc4a1e829e6b398
Author: Andres Freund <andres@anarazel.de>

Modified Files
--------------
doc/src/sgml/bki.sgml                           |   1 +
doc/src/sgml/catalogs.sgml                      |  20 ++-
src/backend/access/common/reloptions.c          | 110 ------------
src/backend/access/common/tupdesc.c             | 228 ++++--------------------
src/backend/bootstrap/bootstrap.c               |   2 +
src/backend/catalog/README.attver.md            |  34 ++--
src/backend/catalog/genbki.pl                   |  11 ++
src/backend/catalog/heap.c                      |  98 ++--------
src/backend/commands/tablecmds.c                |  10 +-
src/backend/executor/execTuples.c               |   9 +
src/backend/utils/cache/relcache.c              |  14 --
src/bin/pg_dump/pg_dump.c                       |  47 +++--
src/bin/pg_upgrade/t/009_composite_types.pl     |  21 ++-
src/include/access/reloptions.h                 |   4 -
src/include/access/tupdesc.h                    |  25 ++-
src/include/catalog/catversion.h                |   2 +-
src/include/catalog/pg_attribute.h              |  12 +-
src/test/regress/expected/alter_table.out       |  10 +-
src/test/regress/expected/attribute_version.out |  14 +-
src/test/regress/sql/alter_table.sql            |  10 +-
src/test/regress/sql/attribute_version.sql      |  14 +-
src/tools/pgindent/typedefs.list                |   1 -
22 files changed, 199 insertions(+), 498 deletions(-)



Message-ID: <E1xQQFs-000000003Ov-0Yf2@gemulon.postgresql.org>
Permalink:  ../E1xQQFs-000000003Ov-0Yf2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQQFs-000000003Ov-0Yf2@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: Move per-attribute version to pg_attribute.attversion
  In-Reply-To: <E1xQQFs-000000003Ov-0Yf2@gemulon.postgresql.org>
  References: <E1xQQFs-000000003Ov-0Yf2@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