From: | Dave Cramer <Dave(at)micro-automation(dot)net> |
---|---|
To: | Panu Outinen <panu(at)vertex(dot)fi> |
Cc: | "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS |
Date: | 2002-04-16 10:34:00 |
Message-ID: | 1018953241.1440.1.camel@inspiron.cramers |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)postgresql(dot)org)
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Panu Outinen | 2002-04-16 11:47:59 | Re: Fixes for JDBC's getColumns() in Postgresql 7.2 & |
Previous Message | Panu Outinen | 2002-04-16 10:17:02 | Fixes for JDBC's getColumns() in Postgresql 7.2 & CVS |