Re: Duplicate tables information through metadata queries

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Duplicate tables information through metadata queries
Дата
Msg-id ab5891c4-7c34-2986-7e15-80461401b4f1@dunslane.net
обсуждение исходный текст
Ответ на RE: Duplicate tables information through metadata queries  ("ldh@laurent-hasson.com" <ldh@laurent-hasson.com>)
Ответы Duplicate tables information through metadata queries
Список pgsql-jdbc
On 9/8/21 5:15 PM, ldh@laurent-hasson.com wrote:
>
> SELECT *
> FROM pg_catalog.pg_class c
>      LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
>      LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0) 
> WHERE c.relname = 'contact'



Umm, that doesn't look right. For queries against pg_description you
need to specify the classoid (in this case 'pg_class'::regclass) as well
as the objoid (and possibly the objsubid). Remember, Oids are not unique
across the whole catalog. I looks to me like here one rwo is picking up
a description for an entry in some other catalog


See https://www.postgresql.org/docs/devel/catalog-pg-description.html


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




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

Предыдущее
От: "ldh@laurent-hasson.com"
Дата:
Сообщение: RE: Duplicate tables information through metadata queries
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Duplicate tables information through metadata queries