Re: [HACKERS] Finding primary keys in a table - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Finding primary keys in a table
Date
Msg-id 199807201918.PAA11113@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Finding primary keys in a table  (darcy@druid.net (D'Arcy J.M. Cain))
List 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 by date:

Previous
From: dg@illustra.com (David Gould)
Date:
Subject: Re: [HACKERS] s_lock.h busted
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] s_lock.h busted