Re: [PATCHES] DatabaseMetaData.getIndexInfo() added

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: William Webber <william(at)ferengi(dot)live(dot)com(dot)au>, pmount(at)retep(dot)org(dot)uk
Cc: pgsql-patches(at)postgresql(dot)org, PostgreSQL jdbc list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [PATCHES] DatabaseMetaData.getIndexInfo() added
Date: 2001-03-19 21:52:07
Message-ID: 200103192152.QAA03942@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches


Peter, can you comment on this patch?

> Hi all!
>
> Attached is a patch that implements DatabaseMetaData.getIndexInfo()
> for the JDBC2 driver. It also fixes a compile error under jikes by
> casting characters in case statements of a byte-compared switch to
> bytes.
>
> A few notes on getIndexInfo():
>
> 1.) getArray() is not implemented for the postgresql JDBC driver yet,
> so getIndexInfo() parses the pg_index.indkey field into separate
> integers by hand.
>
> 2.) I have guessed that if pg_index.indisclustered is "false", then
> the index is "hashed"; if not, line 2561 of the resultant class
> should have "tableIndexOther" rather than "tableIndexHashed".
>
> 3.) I didn't know what sort sequence (if any) was used in indexes, so
> I have set it to "null" (unknown) on line 2566.
>
> 4.) For "CARDINALITY" (number of unique index items, the 11th field of
> the ResultSet returned by getIndexInfo()) I have used
> pg_classes.reltuples.
>
> I have tested this method, but hardly extensively. Is there a proper
> regression test suite for the JDBC driver that tests can be added to?
>
> William
> --
> William Webber william(at)peopleweb(dot)net(dot)au
> Senior Programmer
> PeopleWeb Australia http://www.peopleweb.com

[ Attachment, skipping... ]

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 3.5 KB

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2001-03-19 22:01:26 Re: PostgreSQL and PHP persistent connections
Previous Message Ian Lance Taylor 2001-03-19 21:34:14 Re: Patch application

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-03-19 21:56:54 Email address
Previous Message Marko Kreen 2001-03-19 20:27:38 Re: [PATCHES] Re: org.postgresql.Driver.java compile problem