Re: information_schema and not-null constraints

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: information_schema and not-null constraints
Дата
Msg-id 202309051715.7ghhtqh76hyw@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: information_schema and not-null constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: information_schema and not-null constraints  (Vik Fearing <vik@postgresfriends.org>)
Список pgsql-hackers
On 2023-Sep-05, Alvaro Herrera wrote:

> After looking at what happens for domain constraints in older versions
> (I tested 15, but I suppose this applies everywhere), I notice that we
> don't seem to handle them anywhere that I can see.  My quick exercise is
> just
> 
> create domain nnint as int not null;
> create table foo (a nnint);
> 
> and then verify that this constraint shows nowhere -- it's not in
> DOMAIN_CONSTRAINTS for starters, which is I think the most obvious place.
> And nothing is shown in CHECK_CONSTRAINTS nor TABLE_CONSTRAINTS either.

Looking now at what to do for CHECK_CONSTRAINTS with domain constraints,
I admit I'm completely confused about what this view is supposed to
show.  Currently, we show the constraint name and a definition like
"CHECK (column IS NOT NULL)".  But since the table name is not given, it
is not possible to know to what table the column name refers to.  For
domains, we could show "CHECK (VALUE IS NOT NULL)" but again with no
indication of what domain it applies to, or anything at all that would
make this useful in any way whatsoever.

So this whole thing seems pretty futile and I'm disinclined to waste
much time on it.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: A minor adjustment to get_cheapest_path_for_pathkeys
Следующее
От: Nazir Bilal Yavuz
Дата:
Сообщение: Re: Create shorthand for including all extra tests