On Sun, Feb 18, 2024 at 2:49 AM Tomas Vondra
<tomas.von...@enterprisedb.com> wrote:
>
> An alternative approach would be modifying pg_typeof() to optionally
> determine the base type, depending on a new argument which would default
> to "false" (i.e. the current behavior).
>
> So you'd do
>
>   SELECT pg_typeof(x);
>
> or
>
>   SELECT pg_typeof(x, false);
>
> to get the current behavior, or and
>
>   SELECT pg_typeof(x, true);
>
> to determine the base type.
>
> Perhaps this would be better than adding a new function doing almost the
> same thing as pg_typeof(). But I haven't tried, maybe it doesn't work
> for some reason, or maybe we don't want to do it this way ...
>

pg_typeof is quite hot.
getting the base type of a domain is niche.

changing pg_typeof requires extra effort to make it compatible with
previous behavior.
bundling it together seems not worth it.


Reply via email to