Re: DatabaseMetaData.getIndexInfo and function-based indexes - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: DatabaseMetaData.getIndexInfo and function-based indexes
Date
Msg-id Pine.BSO.4.56.0502182250570.26663@leary.csoft.net
Whole thread Raw
In response to DatabaseMetaData.getIndexInfo and function-based indexes  (peter royal <proyal@pace2020.com>)
Responses Re: DatabaseMetaData.getIndexInfo and function-based indexes
List pgsql-jdbc

On Fri, 18 Feb 2005, peter royal wrote:

> create index my_index on my_Table (upper(my_field) );
>
> it is possible to retrieve the fact that the field is upper(my_field)
> via DMD.getIndexInfo() ?
>
> With 7.4 (and the associated JDBC driver) the column name shows up as
> pg_expression_1 (or something very close to that

This is what is actually stored in the pg_attribute table as the column
name for the index.  Determining what the actual expression is would
involve decoding the pg_index.indexpr column with pg_get_expr, which could
be done, but then some manual parsing would need to be done to split this
into multiple columns for something like (upper(a), lower(b)).  So the
driver can figure this information out, but doesn't presently.

Kris Jurka



pgsql-jdbc by date:

Previous
From: peter royal
Date:
Subject: DatabaseMetaData.getIndexInfo and function-based indexes
Next
From: Tom Lane
Date:
Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes