Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id BAFEF1337B4E for ; Tue, 15 Feb 2011 13:13:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 86820-07 for ; Tue, 15 Feb 2011 17:13:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id 0E96E133655C for ; Tue, 15 Feb 2011 13:13:13 -0400 (AST) Received: from tbz-emx-mobil.localnet ([85.183.3.198]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MGXOi-1PtjxI2xYO-00DE3k; Tue, 15 Feb 2011 18:08:08 +0100 From: "ml-tb" Reply-To: ml-tb@emagixx.de To: pgsql-jdbc@postgresql.org Subject: Issue getColumns(): Nonstandard use of \\ in a string literal Date: Tue, 15 Feb 2011 18:08:06 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102151808.06825.ml-tb@emagixx.de> X-Provags-ID: V02:K0:l1Y4qe6FbdlQ4y/OoiJcXg/mH4RTV3EQhpW/q75BlWc o/6aFzJDPAc52REY+IiHNcHKvH8dksGuj7o8MR3D4jejkkPk2U WHZuCP3b7i7LPFKxDYnoUglQbhdruiwOwy7ZNItdBveTwcj4Pe TUWMaFhqwX9NUvL5EJ2FxSfuF8VXKB1DtAS7BEkukOokcDZUy2 zs+T7JMQwZEaRR5zbiuKg== 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201102/85 X-Sequence-Number: 21483 DB-Version: 9.0.2 Driver: 9.0-801 The metadata area of this driver seems to be a litte bit out of the development or test focus (see also: Double quoted column name from DatabaseMetaData.getIndexInfo). I got the the warning message "nonstandard use of \\ in a string literal" in the logfile from my postgresql server if i use the method getColumns(...) from the DatabaseMetaData of a java.sql.Connection. Following a example to reproduce this message: SQL statemant to create a table. CREATE TABLE "TEST_TABLE" ("COLUMN_A" VARCHAR(30), "COLUMN_B" VARCHAR(30)); The Java code: String tableName = "TEST_TABLE"; Connection con = this.getConnection(); String escape = con.getMetaData().getSearchStringEscape(); tableName = tableName.replace("_", escape + "_"); tableName = tableName.replace("%", escape + "%"); ResultSet rs = con.getMetaData().getColumns(catalog, schema, tableName, null); while (rs.next()) { System.out.println("Column: " + rs.getString("COLUMN_NAME")); } con.close(); After getting the Columns via the DatabaseMetaData the postgresql database server log the following informations: WARNING: nonstandard use of \\ in a string literal at character 912 HINT: Use the escape string syntax for backslashes, e.g., E'\\'. STATEMENT: SELECT * FROM (SELECT n.nspname,c.relname,a.attname,a.atttypid,a.attnotnull,a.atttypmod,a.attlen,row_number() OVER (PARTITION BY a.attrelid ORDER BY a.attnum) AS attnum, pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS adsrc,dsc.description,t.typbasetype,t.typtype FROM pg_catalog.pg_namespace n JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid) JOIN pg_catalog.pg_attribute a ON (a.attrelid=c.oid) JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid) LEFT JOIN pg_catalog.pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum) LEFT JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid) LEFT JOIN pg_catalog.pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class') LEFT JOIN pg_catalog.pg_namespace dn ON (dc.relnamespace=dn.oid AND dn.nspname='pg_catalog') WHERE a.attnum > 0 AND NOT a.attisdropped AND n.nspname LIKE 'public' AND c.relname LIKE 'test\\_table' ) c WHERE true ORDER BY nspname,c.relname,attnum The result of the ReslutSet is correct but I'm wondering about the message. Bye Thomas