From: dmp <danap@ttc-cmc.net>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: getTables() doesn't handle umlauts correctly
Date: Mon, 22 Nov 2010 11:54:30 -0700
Message-ID: <4CEABC66.2010201@ttc-cmc.net> (raw)
In-Reply-To: <AANLkTikcbX=9JD-R07fLa5YrHJc4yRbi-YP-mLsAC8_G@mail.gmail.com>
References: <icc7cc$19a$1@dough.gmane.org>
<icdqc3$v7n$1@news.albasani.net>
<icdsfe$7j8$1@dough.gmane.org>
<AANLkTikcbX=9JD-R07fLa5YrHJc4yRbi-YP-mLsAC8_G@mail.gmail.com>
I also tried the table creation in the MyJSQLView app. which
uses the jdbc, this morning and I just don't see it. The correct
table name is showing up in the public schema and also in the
information_schema.tables as shown by the app.
I also tested the code directly and again the correct table
name is showing up. The only thing different is not on XP, but
with the same server and jdbc versions.
Now you may wish to try just % or null for the tableNamePattern.
Perhaps something is going on with parsing of that parameter.
The API indicates that "a table name pattern; must match the
table name as it is stored in the database"
danap
> Hi,
>
> I noticed that the driver will return incorrect values for table names that contain umlauts. Consider the following code:
>
> Class.forName("org.postgresql.Driver");
> con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "password");
> stmt = con.createStatement();
> stmt.executeUpdate("create table public.umlaut_test_รถ (id integer)");
> rs = con.getMetaData().getTables(null, "public", "umlaut_test%", null);
> while (rs.next())
> {
> System.out.println(rs.getString("TABLE_NAME"));
> }
>
> It will not display the table name correctly.
>
> Now on the console this might be an encoding problem of the client, but the name is also not displayed correctly, when e.g. using a Swing JLabel component which is fully UTF-8 compatible.
>
> Is there a connection parameter for the driver to return that correctly or is this a driver bug?
>
> I'm using the 9.0-801 driver with a 9.0.1 database running on Windows XP
>
> Regards
> Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: danap@ttc-cmc.net, spam_eater@gmx.net
Subject: Re: getTables() doesn't handle umlauts correctly
In-Reply-To: <4CEABC66.2010201@ttc-cmc.net>
References: <icc7cc$19a$1@dough.gmane.org> <icdqc3$v7n$1@news.albasani.net> <icdsfe$7j8$1@dough.gmane.org> <AANLkTikcbX=9JD-R07fLa5YrHJc4yRbi-YP-mLsAC8_G@mail.gmail.com> <4CEABC66.2010201@ttc-cmc.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox