Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement

Поиск
Список
Период
Сортировка
От jian he
Тема Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement
Дата
Msg-id CACJufxHCB1AbtkyLV1WVPmTc2sMvSc_EvTvYcOL_waCUkd4FaA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement  (Tim Waizenegger <tim.waizenegger@enterprisedb.com>)
Список pgsql-hackers
On Wed, Oct 22, 2025 at 5:32 PM Tim Waizenegger
<tim.waizenegger@enterprisedb.com> wrote:
>
> updated patch is attached
>

I’ve done some refactoring, hope it’s now more intuitive to you.
Since a domain’s base type can itself be another domain, it’s better to use

    appendStringInfo(&buf, "CREATE DOMAIN %s AS %s",
                     generate_qualified_type_name(domain_oid),
                     generate_qualified_type_name(typForm->typbasetype));

then the domain's base type is also fully qualified.

I also refactored the logic for printing domain constraints, which should reduce
syscache lookups or table scans compared to your version.

please check the attached.

Вложения

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