Re: How to get the primary key fields?

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: How to get the primary key fields?
Дата
Msg-id 1034968214.22016.18.camel@camel
обсуждение исходный текст
Ответ на How to get the primary key fields?  ("Roberto (SmartBit)" <roberto@smartbit.inf.br>)
Список pgsql-general
SELECT c2.relname
FROM pg_class c, pg_class c2, pg_index i
WHERE c.relname = 'rms_users' AND c.oid = i.indrelid AND i.indexrelid =
c2.oid
AND i.indisprimary AND i.indisunique ORDER BY c2.relname

Robert Treat

On Fri, 2002-10-18 at 12:37, Roberto (SmartBit) wrote:
> Hi all
>
> how could I do a single select resulting a list of field name that are
> primary keys of a table??
>
> please, help me
>
> tia
>
> Roberto Amorim
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: PostgreSQL Benchmarks
Следующее
От: Andrei Ivanov
Дата:
Сообщение: creating a new type in C