Skip site navigation (1) Skip section navigation (2)

Re: DatabaseMetaData.getIndexInfo and function-based indexes

From: Kris Jurka <books(at)ejurka(dot)com>
To: peter royal <proyal(at)pace2020(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes
Date: 2005-02-19 04:07:03
Message-ID: Pine.BSO.4.56.0502182250570.26663@leary.csoft.net (view raw or flat)
Thread:
Lists: 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



In response to

Responses

pgsql-jdbc by date

Next:From: Tom LaneDate: 2005-02-19 05:54:19
Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes
Previous:From: peter royalDate: 2005-02-18 22:55:22
Subject: DatabaseMetaData.getIndexInfo and function-based indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group