Re: cataloguing NOT NULL constraints

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: cataloguing NOT NULL constraints
Дата
Msg-id 471cd41b-c345-3bee-fe97-061f74eba5b8@eisentraut.org
обсуждение исходный текст
Ответ на Re: cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: cataloguing NOT NULL constraints
Re: information_schema and not-null constraints
Список pgsql-hackers
On 31.08.23 12:02, Alvaro Herrera wrote:
> In constraint_column_usage, you're adding a relkind to the catalog scan
> that goes through pg_depend for CHECK constraints.  Here we can rely on
> a simple conkey[1] check and a separate UNION ALL arm[q5]; this is also
> faster when there are many tables.
> 
> The third view definition looks ok.  It's certainly very nice to be able
> to delete XXX comments there.

The following information schema views are affected by the not-null 
constraint catalog entries:

1. CHECK_CONSTRAINTS
2. CONSTRAINT_COLUMN_USAGE
3. DOMAIN_CONSTRAINTS
4. TABLE_CONSTRAINTS

Note that 1 and 3 also contain domain constraints.  So as long as the 
domain not-null constraints are not similarly catalogued, we can't 
delete the separate not-null union branch.  (3 never had one, so 
arguably a bit buggy.)

I think we can fix up 4 by just deleting the not-null union branch.

For 2, the simple fix is also easy, but there are some other options, as 
you discuss above.

How do you want to proceed?




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

Предыдущее
От: Jelte Fennema
Дата:
Сообщение: Re: proposal: psql: show current user in prompt
Следующее
От: "Zhijie Hou (Fujitsu)"
Дата:
Сообщение: RE: persist logical slots to disk during shutdown checkpoint