Bug in getIndexInfo() with 9.0 JDBC driver

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Bug in getIndexInfo() with 9.0 JDBC driver
Date: 2010-09-25 09:38:04
Message-ID: i7kftq$mvg$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

in my program I'm using DatabaseMetaData.getIndexInfo().

This is working fine with the 8.4 driver on a 8.4 and 9.0 database.

However when using the 9.0 driver (postgresql-9.0-801.jdbc4.jar) I'm getting the following exception when calling getIndexInfo():

ERROR: argument to pg_get_expr() must come from system catalogs [SQL State=42501]
org.postgresql.util.PSQLException: ERROR: argument to pg_get_expr() must come from system catalogs
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getIndexInfo(AbstractJdbc2DatabaseMetaData.java:4023)

This is the code that I'm running (error checking removed)

Class.forName("org.postgresql.Driver");
Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "postgres");
ResultSet rs = con.getMetaData().getIndexInfo(null, "public", "mytable", false, false);
while (rs.next())
{
System.out.println(rs.getString("INDEX_NAME"));
}

Thanks
Thomas

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2010-09-25 10:01:29 Re: Bug in getIndexInfo() with 9.0 JDBC driver
Previous Message Kevin Grittner 2010-09-25 02:28:30 Re: Mapping Hibernate boolean to smallint(Postgresql)