Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group