Re: [SQL] SQL-Query 2 get primary key

From: Marc Grimme <grimme(at)atix(dot)de>
To: "jose' soares" <sferac(at)bo(dot)nettuno(dot)it>
Cc: "pgsql-sql(at)postgreSQL(dot)org" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] SQL-Query 2 get primary key
Date: 1999-02-19 17:09:53
Message-ID: 36CD9AE1.F2C412CE@atix.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Hi,

jose' soares wrote:
>
> You may query pg_indexes as in:
>
> select * from pg_indexes where tablename = 'test';
>
> tablename|indexname|indexdef
> ---------+---------+-----------------------------------------------------------------------
>
> test |test_pkey|CREATE UNIQUE INDEX "test_pkey" ON "test" USING
> btree ("id" "int4_ops")
> (1 row)
>
>
>
I read about the pg_indexes table and stuff but I am interested in the
"columnname" of the primary key in the specified table.
Isn´t this feature very important?
Cheers,
Marc
--
-----------------------------------------------------------
Marc Grimme - An der Muehle 1 - 85716 Unterschleissheim
Fon: +49 89 37 48 81 22 - +49 89 37 48 92 7 - 3/0 -
mail2: grimme(at)informatik(dot)tu-muenchen(dot)de, grimme(at)atix(dot)de
-----------------------------------------------------------
The UNIX Guru's View of Sex:
# unzip ; strip ; touch ; finger ; mount ; fsck ; more ; yes ; umount ;
sleep

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1999-02-19 17:45:56 Major bug, possible, with Solaris 7?
Previous Message jose' soares 1999-02-19 16:32:14 Re: [SQL] SQL-Query 2 get primary key

Browse pgsql-sql by date

  From Date Subject
Next Message Martin Möderndorfer 1999-02-19 17:37:57 Triggers to create Tables
Previous Message jose' soares 1999-02-19 16:32:14 Re: [SQL] SQL-Query 2 get primary key