DatabaseMetaData - schemaPattern

From: Kevin Wooten <kdubb(at)me(dot)com>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: DatabaseMetaData - schemaPattern
Date: 2013-11-23 20:47:23
Message-ID: 30FDF4D2-6A8C-4905-8347-6D7026061E4C@me.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


In pgjdbc, I believe the DatabaseMetaData code is incorrectly handling the schemaPattern.

According to the interface docs, an empty schemaPattern should retrieve “those without a schema”. While null means "the schemaPattern should not be used to narrow the search”. This same info appears for any schemaPattern in any method of the interface (http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html)

All through AbstractJdbc2DatabaseMetaData.java, anywhere schemaPattern appears, you’ll see code like this:

if (schemaPattern != null && !"".equals(schemaPattern))
{
sql += ...
}

It seems these should simply be null checks only. Does that seem like the correct interpretation?

-kw

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-11-25 13:53:05 Re: DatabaseMetaData - schemaPattern
Previous Message Kevin Wooten 2013-11-23 06:37:15 PGJDBC-NG 0.0.2