Re: primary key query

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: primary key query
Дата
Msg-id 20051103010400.GA14011@winnie.fuhr.org
обсуждение исходный текст
Ответ на primary key query  (Shuying Wang <wang.shuying.lists@gmail.com>)
Список pgsql-novice
On Thu, Nov 03, 2005 at 11:46:58AM +1100, Shuying Wang wrote:
> Why is relname 'eligibility_type' and not 'enumerations.eligibility_type'?

pg_class.relname stores only the relation name; if you want the
schema name then join pg_class.relnamespace and pg_namespace.oid
and refer to pg_namespace.nspname.  Another way would be to cast
'schemaname.relationname' to regclass and compare it to pg_class.oid:

SELECT ...
FROM pg_class c ...
WHERE c.oid = 'enumerations.eligibility_type'::regclass
  AND ...

--
Michael Fuhr

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

Предыдущее
От: Shuying Wang
Дата:
Сообщение: primary key query
Следующее
От: Afton & Ray Still
Дата:
Сообщение: Re: WinXP Install - Account Password Information