Re: How does one determine which columns are constrained PRIMARY KEY?

From: denis(at)coralindia(dot)com
To: "Damon Fasching" <fasching(at)design(dot)lbl(dot)gov>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How does one determine which columns are constrained PRIMARY KEY?
Date: 2002-03-01 05:34:08
Message-ID: 008501c1c0e2$b6ae4260$0232a8c0@coralindia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I am a novice for PostGres... but if you start postgres with option "-E" it
shows the QUERY which it executes to get result of each "\" command....

Analysing that, you may find something relevant to your prob.

Denis

----- Original Message -----
From: "Damon Fasching" <fasching(at)design(dot)lbl(dot)gov>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Friday, March 01, 2002 1:11 AM
Subject: Re: [NOVICE] How does one determine which columns are constrained
PRIMARY KEY?

> On Thu, 28 Feb 2002, Josh Berkus wrote:
>
> > Damon,
> >
> > > Is it possible to determine which column(s), if any, are constrained
> > > with PRIMARY KEY?
> >
> > From psql, use:
> >
> > \d table_name
> >
> > You will get a list of table characteristics, including any
> > constraints.
> >
> > -Josh
> >
>
> Thanks...but is there a way to check PRIMARY KEY (and do other useful
> things like get a listing of databases) from within an SQL query? I can't
> embed psql '\' commands in my application.
>
> Damon
>
> ---------
>
> May the lights in The Land of Plenty
> shine on the Truth some day L Cohen
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bertil Wergelius 2002-03-01 10:10:10 sorting order
Previous Message Herb Blacker 2002-02-28 22:58:31 Re: No column headings in SQL query