Re: Add pg_basetype() function to obtain a DOMAIN base type

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Add pg_basetype() function to obtain a DOMAIN base type
Дата
Msg-id CACJufxGEZYpiObCaXfD6yCYJ-JW3GS7bcViun+PfEKFu7uC_MQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add pg_basetype() function to obtain a DOMAIN base type  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
On Sun, Feb 18, 2024 at 2:49 AM Tomas Vondra
<tomas.vondra@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.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Add last_commit_lsn to pg_stat_database
Следующее
От: "zwj"
Дата:
Сообщение: bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)