Re: determine if a column is UNIQUE using metadata

From: Kris Jurka <books(at)ejurka(dot)com>
To: Peter Michaux <petermichaux(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: determine if a column is UNIQUE using metadata
Date: 2008-01-20 15:15:19
Message-ID: Pine.BSO.4.64.0801201012410.22317@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 19 Jan 2008, Peter Michaux wrote:

> I've been trying to determine if a column is UNIQUE. I've been trying
> to use the following
>
> connection.getMetaData().getIndexInfo(null, "", "comment", false, true);
>
> but it always says that the columns are not unique.
>
> Am I on the right track with the above technique or should I be trying
> to do something totally different?
>

The driver's test suite includes a test for ensuring NON_UNIQUE is
returned correctly and it works for me. Could you post a complete example
(including table/index creation) of it failing.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Albe Laurenz 2008-01-21 08:27:20 Re: trying to connect to pg from within a local network
Previous Message Peter Michaux 2008-01-20 00:43:00 determine if a column is UNIQUE using metadata