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: Refactor ATExecAddColumn() to use BuildDescForRelation()
Date: Fri, 12 Jan 2024 15:18:22 +0000
Message-ID: <E1rOJIc-0015ow-Cq@gemulon.postgresql.org> (raw)

Refactor ATExecAddColumn() to use BuildDescForRelation()

BuildDescForRelation() has all the knowledge for converting a
ColumnDef into pg_attribute/tuple descriptor.  ATExecAddColumn() can
make use of that, instead of duplicating all that logic.  We just pass
a one-element list of ColumnDef and we get back exactly the data
structure we need.  Note that we don't even need to touch
BuildDescForRelation() to make this work.

Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e4da@eisentraut.org

Branch
------
master

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

Modified Files
--------------
src/backend/commands/tablecmds.c | 89 ++++++++++------------------------------
1 file changed, 22 insertions(+), 67 deletions(-)



Message-ID: <E1rOJIc-0015ow-Cq@gemulon.postgresql.org>
Permalink:  ../E1rOJIc-0015ow-Cq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rOJIc-0015ow-Cq@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: Refactor ATExecAddColumn() to use BuildDescForRelation()
  In-Reply-To: <E1rOJIc-0015ow-Cq@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