how can tell if a column is a primary key?

From: Mark Stosberg <mark(at)summersault(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: how can tell if a column is a primary key?
Date: 1999-11-15 04:57:15
Message-ID: 382F925C.31358F09@summersault.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hello!

I'm writing some perl code to access arbitrary Postgres tables. As part
of this, I would like to be to tell if a given column is a primary key.
Given a table and a column name, is there is a select statement I can
run on the systems tables to tell me whether or not it's a primary key? Thanks.

-mark

--
<<-------------------------------------------------------------->>
personal website < Summersault Website Design
http://mark.stosberg.com/ > http://www.summersault.com/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-11-15 05:18:13 Re: [SQL] Verificate values in other table?
Previous Message Chaotic Inceptions 1999-11-14 21:03:04 Arrays of composites, bug or usage?