Re: Fixes for JDBC's getColumns() in Postgresql 7.2 &

From: Panu Outinen <panu(at)vertex(dot)fi>
To: Dave Cramer <Dave(at)micro-automation(dot)net>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Fixes for JDBC's getColumns() in Postgresql 7.2 &
Date: 2002-04-16 11:47:59
Message-ID: 5.1.0.14.0.20020416134841.035ef750@vertex.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

At 06:34 16.4.2002 -0400, Dave Cramer wrote:
>Panu,
>
>What happens if I actually do have a column with an uppercase name?

It doesn't work BUT then all the other methods (in DatabaseMetaData) like:

DatabaseMetaData.getColumnPrivileges()
DatabaseMetaData.getIndexInfo()
DatabaseMetaData.getProcedures()
DatabaseMetaData.getTables()

should be coded case insensitively, too !!

Now they're all using toLowerCase() with table/column names and 1.33
version of DatabaseMetaData.java used to have it also

- Panu

>Dave
>On Tue, 2002-04-16 at 06:17, Panu Outinen wrote:
> >
> > Following patches are against the current CVS version (HEAD) as of
> 2002-04-16.
> >
> > Especially the current CVS version of DatabaseMetaData.getColumns()
> doesn't
> > work at all because the CVS version 1.50 of
> > org/postgresql/jdbc2/DatabaseMetaData.java has accidentally wiped out
> the row:
> >
> > v.addElement(tuple);
> >
> > - Panu
> >
> > PS. Only the JDBC2 version was tested !!
> >
> > ---------------------------------------------------------------------------
> >
> > --- org/postgresql/jdbc2/DatabaseMetaData.java.org Tue Apr 16
> 11:17:34 2002
> > +++ org/postgresql/jdbc2/DatabaseMetaData.java Tue Apr 16
> 11:32:12 2002
> > @@ -2053,12 +2053,12 @@
> >
> > if ((tableNamePattern != null) && !
> tableNamePattern.equals("%"))
> > {
> > - sql.append(" and c.relname like \'" +
> tableNamePattern + "\'");
> > + sql.append(" and c.relname like \'" +
> tableNamePattern.toLowerCase() +
> > "\'");
> > }
> >
> > if ((columnNamePattern != null) && !
> columnNamePattern.equals("%"))
> > {
> > - sql.append(" and a.attname like \'" +
> columnNamePattern + "\'");
> > + sql.append(" and a.attname like \'" +
> columnNamePattern.toLowerCase() +
> > "\'");
> > }
> >
> > sql.append(
> > @@ -2146,6 +2146,7 @@
> > tuple[16] =
> r.getBytes(5); // ordinal position
> > tuple[17] = (nullFlag.equals("f") ? "YES" :
> "NO").getBytes(); // Is
> > nullable
> >
> > + v.addElement(tuple);
> > }
> > r.close();
> >
> >
> >
> > --- org/postgresql/jdbc1/DatabaseMetaData.java.org Tue Mar 5
> 05:02:47 2002
> > +++ org/postgresql/jdbc1/DatabaseMetaData.java Tue Apr 16
> 11:45:15 2002
> > @@ -1953,12 +1953,12 @@
> >
> > if ((tableNamePattern != null) && !
> tableNamePattern.equals("%"))
> > {
> > - sql.append(" and c.relname like
> \'" + tableNamePattern +
> > "\'");
> > + sql.append(" and c.relname like \'" +
> > tableNamePattern.toLowerCase() + "\'");
> > }
> >
> > if ((columnNamePattern != null) && !
> columnNamePattern.equals("%"))
> > {
> > - sql.append(" and a.attname like
> \'" + columnNamePattern
> > + "\'");
> > + sql.append(" and a.attname like \'" +
> > columnNamePattern.toLowerCase() + "\'");
> > }
> >
> > sql.append(
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> >
> >
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

------
Panu Outinen Tel. +358 9 2706 8132
Vertex Systems Oy GSM +358 400 627 800
Pitkänsillanranta 3 A, 5.krs http://www.vertex.fi
00530 Helsinki, FINLAND mailto:Panu(dot)Outinen(at)vertex(dot)fi

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-04-16 12:54:31 test cases failing?
Previous Message Dave Cramer 2002-04-16 10:34:00 Re: Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS