Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Michael Fuhr
On Thu, Mar 30, 2006 at 03:13:12PM +0400, Sergey Karin wrote: > Are there any abilities to detect primary key of a table? In psql you could use "\d tablename". To see the queries that psql makes, execute "\set ECHO_HIDDEN" and then "\d tablename". Here's the documentation for the system catalogs

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Tino Wildenhain
Sergey Karin schrieb: Yes, it is not a problem via psql. But I want to detect primary key via libpq (e.g using select commands) Look into informational-schema or start psql with the option -e then use \d+ and see what it prints :-) Regards Tino ---(end of broadcast)-

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Sergey Karin
Yes, it is not a problem via psql.But I want to detect primary key via libpq (e.g using select commands)2006/3/30, Michael Kleiser < [EMAIL PROTECTED]>:\d your_tablewill show it>> create table foobar ( foo int primary key, bar int ); NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index"fo

[GENERAL] How to detect primary key of a table

2006-03-30 Thread Sergey Karin
Hi, List!I use PG8.1Are there any abilities to detect primary key of a table?Sergey Karin