Add primary keys to system catalogs

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Add primary keys to system catalogs
Дата
Msg-id dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com
обсуждение исходный текст
Ответы Re: Add primary keys to system catalogs  (Craig Ringer <craig.ringer@enterprisedb.com>)
Re: Add primary keys to system catalogs  (Andres Freund <andres@anarazel.de>)
Re: Add primary keys to system catalogs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Re: Add primary keys to system catalogs  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
I saw someone ask once for a schema diagram of the system catalogs. 
Things like that have occasionally been produced manually, but they are 
not regularly updated.  That made me wonder, why can't we add primary 
and foreign keys to system catalogs and then have existing tools produce 
such a schema diagram automatically?

Since we have ADD PRIMARY KEY USING INDEX, we can declare a primary key 
for an existing index.  So this doesn't have to affect the low-level 
early bootstrapping.  The attached patch adds those commands manually. 
Another option might be to have the catalog generation Perl tooling 
create those declarations automatically from some marker in the catalog 
files.  That would also allow declaring unique constraints for the 
unique indexes that don't end up being the primary key.

I'm not dealing here with how we might do foreign keys between system 
catalogs, but I think the idea would be to have some way to declare a 
foreign key "on paper" without any actual triggers.

Any thoughts on this direction?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Jürgen Purtz
Дата:
Сообщение: Re: [PATCH] Add section headings to index types doc
Следующее
От: Kuntal Ghosh
Дата:
Сообщение: Re: Incorrect assumption in heap_prepare_freeze_tuple