pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: peter royal <proyal@pace2020.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes
Date: Fri, 18 Feb 2005 23:07:03 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0502182250570.26663@leary.csoft.net> (raw)
In-Reply-To: <2BDB6E76-8200-11D9-8AAF-000A95AC787E@pace2020.com>
References: <2BDB6E76-8200-11D9-8AAF-000A95AC787E@pace2020.com>



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





view thread (8+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0502182250570.26663@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0502182250570.26663@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0502182250570.26663@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, proyal@pace2020.com
  Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes
  In-Reply-To: <Pine.BSO.4.56.0502182250570.26663@leary.csoft.net>
  References: <2BDB6E76-8200-11D9-8AAF-000A95AC787E@pace2020.com> <Pine.BSO.4.56.0502182250570.26663@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox