Re: find column OID types with information schema?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: find column OID types with information schema?
Дата
Msg-id 7188.1240852186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: find column OID types with information schema?  (Whit Armstrong <armstrong.whit@gmail.com>)
Ответы Re: find column OID types with information schema?  (Whit Armstrong <armstrong.whit@gmail.com>)
Список pgsql-general
Whit Armstrong <armstrong.whit@gmail.com> writes:
> Am I misinterpreting this documentation?  Are there cases in which the
> OID's of two tables will collide?  I don't see any uniqueness
> constraints on the pg_class table.

You didn't look too hard:

regression=# \d pg_class
...
Indexes:
    "pg_class_oid_index" UNIQUE, btree (oid)
    "pg_class_relname_nsp_index" UNIQUE, btree (relname, relnamespace)

All system catalogs that have OIDs at all effectively treat them as a
primary key.  If they weren't unique identifiers they wouldn't be good
for much ...

What the documentation is trying to point out is that the uniqueness
guarantees don't extend across tables.  So for example a table and a
datatype could by coincidence have the same OID, since they live in
different system catalogs.

            regards, tom lane

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

Предыдущее
От: Whit Armstrong
Дата:
Сообщение: Re: find column OID types with information schema?
Следующее
От: Whit Armstrong
Дата:
Сообщение: Re: find column OID types with information schema?