domain for WITHOUT OVERLAPS

Поиск
Список
Период
Сортировка
От jian he
Тема domain for WITHOUT OVERLAPS
Дата
Msg-id CACJufxGoAmN_0iJ=hjTG0vGpOSOyy-vYyfE+-q0AWxrq2_p5XQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: domain for WITHOUT OVERLAPS
Список pgsql-hackers
hi.

While working on domain IS JSON, I found out that
WITHOUT OVERLAPS does not support for domain too.
but it does support user-defined range types (via CREATE TYPE).

after looking around:
check_exclusion_or_unique_constraint->ExecWithoutOverlapsNotEmpty
ExecWithoutOverlapsNotEmpty typtype should be domain's basetype's typtype
otherwise it will fallback to:
            elog(ERROR, "WITHOUT OVERLAPS column \"%s\" is not a range
or multirange",
                 NameStr(attname));

That means we need to cheaply get the domain basetype's
pg_type.typtype in lookup_type_cache.
so I added a new char field: TypeCacheEntry.domainBaseTyptype.

it should be working:
For primary key, unique constraint: pg_index.indclass is
the same for domain and basetype.
no need to worry too much about pg_index.indcollation because range type is not
collateable.
For foreign key: pg_constraint (conpfeqop, conppeqop, conffeqop) are the same
for domain and basetype.


--
jian
https://www.enterprisedb.com/

Вложения

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