From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Kris Jurka <books(at)ejurka(dot)com> |
Cc: | peter royal <proyal(at)pace2020(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: DatabaseMetaData.getIndexInfo and function-based indexes |
Date: | 2005-02-19 05:54:19 |
Message-ID: | 14458.1108792459@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Kris Jurka <books(at)ejurka(dot)com> writes:
> 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.
FYI, pg_get_indexdef makes that pretty simple in PG >= 7.4:
regression=# create table t1 (f1 text, f2 text);
CREATE TABLE
regression=# create index t1i on t1(upper(f1), lower(f2));
CREATE INDEX
regression=# select pg_get_indexdef('t1i'::regclass, 1, false);
pg_get_indexdef
-----------------
upper(f1)
(1 row)
regression=# select pg_get_indexdef('t1i'::regclass, 2, false);
pg_get_indexdef
-----------------
lower(f2)
(1 row)
and before 7.4 we don't support multicolumn functional indexes anyway.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | peter royal | 2005-02-19 14:02:52 | Re: DatabaseMetaData.getIndexInfo and function-based indexes |
Previous Message | Kris Jurka | 2005-02-19 04:07:03 | Re: DatabaseMetaData.getIndexInfo and function-based indexes |