Re: [HACKERS] Finding primary keys in a table

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Finding primary keys in a table
Дата
Msg-id 199807201918.PAA11113@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Finding primary keys in a table  (darcy@druid.net (D'Arcy J.M. Cain))
Список pgsql-hackers
> Thus spake Bruce Momjian
> > > Can someone suggest a SQL statement to pull out the primary key(s) from
> > > a table?
> > Because we just create a unique index on a PRIMARY specification, I
> > think any unique index on a field shows it as primary.
>
> Hmm.  Any chance we can somehow flag it as well?  Perhaps a new bool
> field in pg_index the next time we do a dump & reload release?  I
> assume we will need it eventually anyway.

Yes, we will.  The question is when to add it.  Probably best to wait
until we do the whole thing.  If we do it now, it is probable it will
change when we add foreign keys.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

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

Предыдущее
От: dg@illustra.com (David Gould)
Дата:
Сообщение: Re: [HACKERS] s_lock.h busted
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] s_lock.h busted