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

From Alvaro Herrera
Subject Re: Returning the name of a primary key
Date
Msg-id 20050516183503.GA7400@surnet.cl
Whole thread Raw
In response to Returning the name of a primary key  (Juan Pablo Espino <jp.espino@gmail.com>)
Responses Re: Returning the name of a primary key
List pgsql-hackers
On Mon, May 16, 2005 at 01:25:46PM -0500, Juan Pablo Espino wrote:

> 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:

Why mess around with a C function, if you can do it in straight SQL?
You can write a SQL function if need be.

-- 
Alvaro Herrera (<alvherre[a]surnet.cl>)
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos / con todos los humanos acabaré (Bender)


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: bitmap scans, btree scans, and tid order
Next
From: Tom Lane
Date:
Subject: Re: bitmap scans, btree scans, and tid order