Re: getIndexInfo() not returning operator classes - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: getIndexInfo() not returning operator classes
Date
Msg-id Pine.BSO.4.61.0511101320340.18952@leary.csoft.net
Whole thread Raw
In response to Re: getIndexInfo() not returning operator classes  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: getIndexInfo() not returning operator classes  (Thomas Kellerer <spam_eater@gmx.net>)
Re: getIndexInfo() not returning operator classes  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: getIndexInfo() not returning operator classes
Next
From: Thomas Kellerer
Date:
Subject: Re: getIndexInfo() not returning operator classes