Re: Add primary keys to system catalogs

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Add primary keys to system catalogs
Дата
Msg-id e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: Add primary keys to system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Add primary keys to system catalogs  (Vik Fearing <vik@postgresfriends.org>)
Re: Add primary keys to system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, 2021-01-17 at 17:07 -0500, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > [ v2-0001-Add-primary-keys-and-unique-constraints-to-system.patch ]
> 
> [...] do we really want to prefer
> using the OID indexes as the primary keys?  In most cases there's some
> other index that seems to me to be what a user would think of as the
> pkey, for example pg_class_relname_nsp_index for pg_class or
> pg_proc_proname_args_nsp_index for pg_proc.  Preferring OID where it
> exists is a nice simple rule, which has some attractiveness, but the
> OID indexes seem to me like a lookup aid rather than the "real" object
> identity.

I disagree.  The OID is the real, immutable identity of an object.
The "relname" of a "pg_class" encatalogtry can change any time.
Since there are no foreign keys that reference catalogs, that won't cause
problems, but I still think that primary keys should change as little as
possible.

Yours,
Laurenz Albe




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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: TOAST condition for column size
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: [patch] Help information for pg_dump