Re: locating a primary key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Orion <lab(at)orangekids(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: locating a primary key
Date: 2006-04-20 03:18:48
Message-ID: 6596.1145503128@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Orion <lab(at)orangekids(dot)org> writes:
> I'm trying to craft a query that will determine what column(s) belong
> to the primary key for a given table.

The information_schema.key_column_usage view might help.

> This is all due to the use of
> the int2vect type on indkey which is undocumented and does not seem to
> work with normal array tools such as ANY and cant be cast to int2[].

As of 8.1 it can ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2006-04-20 03:38:06 Re: primary keys
Previous Message Orion 2006-04-20 02:46:45 locating a primary key