On Mon, May 16, 2005 at 02:35:03PM -0400, Alvaro Herrera wrote: > 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.
http://lnk.nu/cvs.pgfoundry.org/2op.sql is an example of how to get the info in pure SQL. -- Jim C. Nasby, Database Consultant [EMAIL PROTECTED] Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?" ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster