Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2293E1337BBB for ; Thu, 24 Mar 2011 17:45:35 -0300 (ADT) 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 29621-06 for ; Thu, 24 Mar 2011 20:45:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id A9BDA1337B4E for ; Thu, 24 Mar 2011 17:45:27 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q2rPJ-0005Qv-B4 for pgsql-jdbc@postgresql.org; Thu, 24 Mar 2011 21:45:25 +0100 Received: from 188.174.137.46 ([188.174.137.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 21:45:25 +0100 Received: from spam_eater by 188.174.137.46 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 21:45:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: How to retrieve column names for tables with underscores Date: Thu, 24 Mar 2011 21:45:13 +0100 Lines: 18 Message-ID: References: <201103241618.32280.ml-tb@emagixx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 188.174.137.46 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.779 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_NUMERIC_HELO=1.164, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01, URIBL_RHS_DOB=1.514 X-Spam-Level: X-Archive-Number: 201103/45 X-Sequence-Number: 21600 Kris Jurka wrote on 24.03.2011 21:18: >> Am Donnerstag, 24. M?rz 2011 schrieb Thomas Kellerer: >>> backslash escape ("table1\_") but that didn't work. >> IMHO it should be "table1\\_"? >> > > The escape needed depends on the value of standard_conforming_strings. You should use this call to find the escape needed: > > http://download.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getSearchStringEscape() > That works perfectly. Actually the fact that "it didn't work" right way was that I used replaceAll() instead of replace() somehow forgetting that replaceAll() needs a regex... Interesting enough, the setting of standard_conforming_strings does not seem to affect this at all. Am I missing something? Thanks Thomas