Re: [HACKERS] Returning the name of a primary key

2005-05-17 Thread John Hansen
AM > To: Juan Pablo Espino > Cc: pgsql-hackers@postgresql.org > Subject: Re: [HACKERS] Returning the name of a primary key > > Juan Pablo Espino <[EMAIL PROTECTED]> writes: > > I need to write a function that retrieve the name of at least one > > table primary key, if it e

Re: [HACKERS] Returning the name of a primary key

2005-05-16 Thread Jim C. Nasby
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 tab

Re: [HACKERS] Returning the name of a primary key

2005-05-16 Thread Tom Lane
Juan Pablo Espino <[EMAIL PROTECTED]> 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

Re: [HACKERS] Returning the name of a primary key

2005-05-16 Thread Alvaro Herrera
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 fu