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

From: Damon Fasching <fasching(at)design(dot)lbl(dot)gov>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How does one determine which columns are constrained PRIMARY KEY?
Date: 2002-02-28 19:41:39
Message-ID: Pine.SOL.3.96.1020228113630.6654A-100000@design.lbl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-02-28 21:18:35 Re: ElseIF in PLPGSQL
Previous Message Josh Berkus 2002-02-28 16:44:02 Re: Migrate an Oracle Table with CLOB datatype