Re: Returning the name of a primary key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Juan Pablo Espino <jp(dot)espino(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Returning the name of a primary key
Date: 2005-05-16 18:49:03
Message-ID: 20151.1116269343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Juan Pablo Espino <jp(dot)espino(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-05-16 18:51:48 Re: Cost of XLogInsert CRC calculations
Previous Message Lamar Owen 2005-05-16 18:45:40 Re: pgFoundry