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

Re: 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>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: DatabaseMetaData.getIndexInfo() added
Date: 2001-05-16 17:46:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbcpgsql-patches
Patch applied to jdbc1 and jdbc2.  This allows index lookups from jdbc. 

> 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                

[ Attachment, skipping... ]

  Bruce Momjian                        |
  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

In response to

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-05-16 19:45:58
Subject: Re: Re: GIST question
Previous:From: Bruce MomjianDate: 2001-05-16 17:08:08
Subject: Re: getScale() and getPrecision() patch

pgsql-jdbc by date

Next:From: User JOHNDate: 2001-05-16 19:51:23
Subject: Restore from a dead machine.
Previous:From: Mark D. ApolinskiDate: 2001-05-16 17:41:07
Subject: Help: Postgresql/JDBC database access error

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