Re: Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS
Date
Msg-id 1018953241.1440.1.camel@inspiron.cramers
Whole thread Raw
In response to Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS  (Panu Outinen <panu@vertex.fi>)
Responses Re: Fixes for JDBC's getColumns() in Postgresql 7.2 &
List pgsql-jdbc
Panu,

What happens if I actually do have a column with an uppercase name?

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@postgresql.org)
>
>




pgsql-jdbc by date:

Previous
From: Panu Outinen
Date:
Subject: Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS
Next
From: Panu Outinen
Date:
Subject: Re: Fixes for JDBC's getColumns() in Postgresql 7.2 &