Re: getIndexInfo() not returning operator classes

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getIndexInfo() not returning operator classes
Date: 2005-11-10 18:39:02
Message-ID: Pine.BSO.4.61.0511101320340.18952@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 10 Nov 2005, Thomas Kellerer wrote:

> Sorry, I meant COLUMN_NAME (internally I'm collecting all values from
> COLUMN_NAME into a field definition, that's where the error comes from).
>

Are you sure you want to be using getIndexInfo for this instead of
something more pg specific like the pg_get_indexdef function?

Aside from this very specific problem (overlapping indexes with different
opclasses), I don't think I'd ever want to see the opclass in the column
name. Certainly not if I was using the default opclass, and probably not
if I was using a non-default opclass, but that was the only index on that
column.

> That column will e.g. contain something like "lower(name)" for a
> function based index, so I don't see a reason why it couldn't contain
> "bar varchar_pattern_ops" In both cases it's not the column's name any
> longer
>

In the function case the indexed data is not the column data, so putting
the column's name is misleading. In the opclass case the indexed data is
really the column's data so the column name is accurate. The fact that
it is indexed differently for different operations upon it is not terribly
relevent to the column name at least.

I personally don't think adding opclass to the column_name is a good idea,
but you're welcome to try and sway me with a convincing argument or
popular support.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2005-11-10 19:06:14 Re: getIndexInfo() not returning operator classes
Previous Message Thomas Kellerer 2005-11-10 18:03:10 Re: getIndexInfo() not returning operator classes