Re: Returning the name of a primary key - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Returning the name of a primary key
Date
Msg-id 20151.1116269343@sss.pgh.pa.us
Whole thread Raw
In response to Returning the name of a primary key  (Juan Pablo Espino <jp.espino@gmail.com>)
List pgsql-hackers
Juan Pablo Espino <jp.espino@gmail.com> writes:
> I need to write a function that retrieve the name of at least one
> table primary key, if it exists.  The only argument passed to the
> function is the table name.  I have thought something like this:

You need to be searching the list of indexes, not the attributes per se.
ATExecDropNotNull() might be a useful example.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: pgFoundry
Next
From: Simon Riggs
Date:
Subject: Re: Cost of XLogInsert CRC calculations