Re: [HACKERS] Finding primary keys in a table

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Finding primary keys in a table
Date: 1998-07-20 19:18:55
Message-ID: 199807201918.PAA11113@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Hartwig 1998-07-20 19:35:23 Re: [HACKERS] Current sources?
Previous Message David Gould 1998-07-20 19:15:46 Re: [HACKERS] s_lock.h busted