Re: Returning the name of a primary key
| От | Jim C. Nasby |
|---|---|
| Тема | Re: Returning the name of a primary key |
| Дата | |
| Msg-id | 20050517052425.GK30902@decibel.org обсуждение исходный текст |
| Ответ на | Re: Returning the name of a primary key (Alvaro Herrera <alvherre@surnet.cl>) |
| Список | pgsql-hackers |
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 decibel@decibel.org 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?"
В списке pgsql-hackers по дате отправления: