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

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

From
Michael Olivier
Date:
This doesn't work for me in 6.3.2-10 on RH Linux. Is this a newer
feature?


---jose' soares <sferac@bo.nettuno.it> 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)

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

From
"jose' soares"
Date:

Michael Olivier ha scritto:

> This doesn't work for me in 6.3.2-10 on RH Linux. Is this a newer
> feature?
>
> ---jose' soares <sferac@bo.nettuno.it> 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)
>

This is my version:

hygea=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

--
                               - Jose' -