Finding the primary key of tables - Mailing list pgsql-general

From George Silva
Subject Finding the primary key of tables
Date
Msg-id AANLkTin5e4ybJHwVRO3R4JvM=Zb2RD+mH+=USjA5TiAy@mail.gmail.com
Whole thread Raw
Responses Re: Finding the primary key of tables
Re: Finding the primary key of tables
Re: Finding the primary key of tables
List pgsql-general
Hello guys,

I'm building a function which needs to know what is the primary key of a certain table (all in pgplsql).

I was using select * from information_schema.key_column_usage where table_schema='foo' and table_name = 'aaa'; but that will give me multiple results in case of additional keys in the table.

Any suggestions?

--
George R. C. Silva

Desenvolvimento em GIS
http://blog.geoprocessamento.net

pgsql-general by date:

Previous
From: David Kerr
Date:
Subject: Question about Idle in TX
Next
From: John R Pierce
Date:
Subject: Re: Question about Idle in TX