pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_basetype() function to extract a domain's base type.
Date: Sat, 30 Mar 2024 17:57:24 +0000
Message-ID: <E1rqcxI-006WjT-EO@gemulon.postgresql.org> (raw)

Add pg_basetype() function to extract a domain's base type.

This SQL-callable function behaves much like our internal utility
function getBaseType(), except it returns NULL rather than failing for
an invalid type OID.  (That behavior is modeled on our experience with
other catalog-inquiry functions such as the ACL checking functions.)
The key advantage over doing a join to pg_type is that it will loop
as needed to find the bottom base type of a nest of domains.

Steve Chavez, reviewed by jian he and others

Discussion: https://postgr.es/m/CAGRrpzZSX8j=MQcbCSEisFA=ic=K3bknVfnFjAv1diVJxFHJvg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/func.sgml               | 24 +++++++++++++++++++
src/backend/utils/adt/misc.c         | 45 ++++++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h     |  2 +-
src/include/catalog/pg_proc.dat      |  3 +++
src/test/regress/expected/domain.out | 25 ++++++++++++++++++++
src/test/regress/sql/domain.sql      | 12 ++++++++++
6 files changed, 110 insertions(+), 1 deletion(-)



view thread (2+ messages)

Message-ID: <E1rqcxI-006WjT-EO@gemulon.postgresql.org>
Permalink:  ../E1rqcxI-006WjT-EO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rqcxI-006WjT-EO@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add pg_basetype() function to extract a domain's base type.
  In-Reply-To: <E1rqcxI-006WjT-EO@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