pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Generalize handling of nullable pg_attribute columns in DDL
Date: Sun, 17 Mar 2024 11:53:21 +0000
Message-ID: <E1rlp4q-004H0r-Mw@gemulon.postgresql.org> (raw)

Generalize handling of nullable pg_attribute columns in DDL

DDL code uses tuple descriptors to pass around pg_attribute values
during table and index creation.  But tuple descriptors don't include
the variable-length/nullable columns of pg_attribute, so they have to
be handled separately.  Right now, the attoptions field is handled in
a one-off way with a separate argument passed to
InsertPgAttributeTuples().  The other affected fields of pg_attribute
are right now not needed at relation creation time.

The goal of this patch is to generalize this to allow handling
additional variable-length/nullable columns of pg_attribute in a
similar manner.  For that, create a new struct
FormExtraData_pg_attribute, which is to be passed around in parallel
to the tuple descriptor and optionally supplies the additional
columns.  Right now, this struct only contains one field for
attoptions, so no functionality is actually changed by this.

Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184c76@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d939cb2fd612acde0304913213cfbdb01994e682

Modified Files
--------------
src/backend/catalog/heap.c         | 21 ++++++++++++++-------
src/backend/catalog/index.c        | 16 +++++++++++++++-
src/include/catalog/heap.h         |  2 +-
src/include/catalog/pg_attribute.h | 13 +++++++++++++
src/tools/pgindent/typedefs.list   |  1 +
5 files changed, 44 insertions(+), 9 deletions(-)



view thread (2+ messages)

Message-ID: <E1rlp4q-004H0r-Mw@gemulon.postgresql.org>
Permalink:  ../E1rlp4q-004H0r-Mw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rlp4q-004H0r-Mw@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: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Generalize handling of nullable pg_attribute columns in DDL
  In-Reply-To: <E1rlp4q-004H0r-Mw@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