Re: [SQL] SQL-Query 2 get primary key - Mailing list pgsql-sql

From Marc Grimme
Subject Re: [SQL] SQL-Query 2 get primary key
Date
Msg-id 36CD9AE1.F2C412CE@atix.de
Whole thread Raw
In response to SQL-Query 2 get primary key  (Marc Grimme <grimme@atix.de>)
List 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@informatik.tu-muenchen.de, grimme@atix.de
-----------------------------------------------------------
The UNIX Guru's View of Sex:
# unzip ; strip ; touch ; finger ; mount ; fsck ; more ; yes ; umount ;
sleep

pgsql-sql by date:

Previous
From: "jose' soares"
Date:
Subject: Re: [SQL] SQL-Query 2 get primary key
Next
From: Martin Möderndorfer
Date:
Subject: Triggers to create Tables