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: Add TupleDescGetDefault()
Date: Wed, 27 Sep 2023 17:58:56 +0000
Message-ID: <E1qlYoK-006JLW-KE@gemulon.postgresql.org> (raw)

Add TupleDescGetDefault()

This unifies some repetitive code.

Note: I didn't push the "not found" error message into the new
function, even though all existing callers would be able to make use
of it.  Using the existing error handling as-is would probably require
exposing the Relation type via tupdesc.h, which doesn't seem
desirable.  (Or even if we changed it to just report the OID, it would
inject the concept of a relation containing the tuple descriptor into
tupdesc.h, which might be a layering violation.  Perhaps some further
improvements could be considered here separately.)

Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e4da%40eisentraut.org

Branch
------
master

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

Modified Files
--------------
src/backend/access/common/tupdesc.c  | 25 +++++++++++++++++++++++++
src/backend/commands/tablecmds.c     | 17 ++---------------
src/backend/parser/parse_utilcmd.c   | 13 ++-----------
src/backend/rewrite/rewriteHandler.c | 16 +---------------
src/include/access/tupdesc.h         |  2 ++
5 files changed, 32 insertions(+), 41 deletions(-)



Message-ID: <E1qlYoK-006JLW-KE@gemulon.postgresql.org>
Permalink:  ../E1qlYoK-006JLW-KE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qlYoK-006JLW-KE@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: Add TupleDescGetDefault()
  In-Reply-To: <E1qlYoK-006JLW-KE@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