Re: DatabaseMetaData - schemaPattern - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: DatabaseMetaData - schemaPattern
Date
Msg-id CADK3HHLg2k+dVxy8FPSCmqy0+7UszEm9ohEPhz5DSez+EGvaDg@mail.gmail.com
Whole thread Raw
In response to DatabaseMetaData - schemaPattern  (Kevin Wooten <kdubb@me.com>)
List pgsql-jdbc
Kevin,

Thanks!

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Sat, Nov 23, 2013 at 3:47 PM, Kevin Wooten <kdubb@me.com> wrote:

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

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: Kevin Wooten
Date:
Subject: DatabaseMetaData - schemaPattern
Next
From: Marc Mamin
Date:
Subject: JDBC & custom type of variable types (!)