Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id BEC351337B4A for ; Mon, 22 Nov 2010 14:54:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 94641-09 for ; Mon, 22 Nov 2010 18:54:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 2A7EC1337B98 for ; Mon, 22 Nov 2010 14:54:09 -0400 (AST) Received: from [192.168.157.32] (te53.montanavision.com [216.220.28.53]) by outbound.vnet-inc.com (Postfix) with ESMTP id 1D0235986; Mon, 22 Nov 2010 11:54:08 -0700 (MST) Message-ID: <4CEABC66.2010201@ttc-cmc.net> Date: Mon, 22 Nov 2010 11:54:30 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: Thomas Kellerer CC: pgsql-jdbc@postgresql.org Subject: Re: getTables() doesn't handle umlauts correctly References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/61 X-Sequence-Number: 21182 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