Re: Add pg_basetype() function to obtain a DOMAIN base type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add pg_basetype() function to obtain a DOMAIN base type
Date
Msg-id 3738840.1708217258@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add pg_basetype() function to obtain a DOMAIN base type  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> On 2/17/24 20:20, Tom Lane wrote:
>> I don't have an immediate proposal for exactly what to call such a
>> function, but naming it by analogy to pg_typeof would be questionable.

> Are you objecting to the pg_basetypeof() name, or just to it accepting
> "any" argument? I think pg_basetypeof(regtype) would work ...

I'm not sure.  "pg_basetypeof" seems like it invites confusion with
"pg_typeof", but I don't really have a better idea.  Perhaps
"pg_baseofdomain(regtype)"?  I'm not especially thrilled with that,
either.

Also, just to be clear, we intend this to drill down to the bottom
non-domain type, right?  Do we need a second function that goes
down only one level?  I'm inclined to say "no", mainly because
(1) that would complicate the naming situation even more, and
(2) that use-case is pretty easy to handle with a sub-select.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: date_trunc function in interval version
Next
From: Andres Freund
Date:
Subject: Re: PGC_SIGHUP shared_buffers?