X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4D14E8B9C1E for ; Sat, 19 Feb 2005 04:07:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03027-09 for ; Sat, 19 Feb 2005 04:07:06 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 002AA8B9F57 for ; Sat, 19 Feb 2005 04:07:05 +0000 (GMT) Received: (qmail 29736 invoked by uid 1112); 19 Feb 2005 04:07:03 -0000 Date: Fri, 18 Feb 2005 23:07:03 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: peter royal Cc: pgsql-jdbc@postgresql.org Subject: Re: DatabaseMetaData.getIndexInfo and function-based indexes In-Reply-To: <2BDB6E76-8200-11D9-8AAF-000A95AC787E@pace2020.com> Message-ID: References: <2BDB6E76-8200-11D9-8AAF-000A95AC787E@pace2020.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/131 X-Sequence-Number: 12311 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