Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 37FD11337BD3 for ; Thu, 24 Mar 2011 19:52:44 -0300 (ADT) 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 86713-09 for ; Thu, 24 Mar 2011 22:52:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp102.prem.mail.ac4.yahoo.com (smtp102.prem.mail.ac4.yahoo.com [76.13.13.41]) by mail.postgresql.org (Postfix) with SMTP id 86F8013364DE for ; Thu, 24 Mar 2011 19:52:33 -0300 (ADT) Received: (qmail 47986 invoked from network); 24 Mar 2011 22:52:33 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=H5hbzvN9hdOvVO54PEQ/QfuPPQwLo/DqLFZyE4AU89XMntADmp/gBZztrN/+nFP9dma2tUDGKY23dgGAoyAelyG4v4TWbVXbTukFtFMXkTQ1RLrYhCTzZSvxGJ8HzriwtmBjG8Q/dElp9RwtywE8Mre4K4rI6skCGzah77R5hR4= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1301007153; bh=UWNF45U64w39fh8Y/KYDUpuo9pSV+vunV0ssGyqTeU0=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=NxffA+P9zV8eIbe9DjPeA2q936B60IKMv3BXYRe8rsrO8cGuQctIIYQN/TYKgdrJLLAPAJjsQPG9P2t0znQSol6UPUJbq+34iniNYSGzs5FAW1wEtbF449IKXzeuugedJHhvOc+wbQuZ500eyYR9mcEunUJlnUb4/WSvi8HS470= Received: from WolfDog (polobo@67.253.155.35 with login) by smtp102.prem.mail.ac4.yahoo.com with SMTP; 24 Mar 2011 22:52:33 +0000 UTC X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- X-YMail-OSG: H6a__dEVM1lJQSR8plBI4_2SlmcM3oUvomN08r5H11oTCod ryGfvCRoVjjCprTy4Rfdlw89DYLuqQkD8nqkv5iIy3twr8iYYKAEFthnlEaR BUt7e83ho_iYbbRKLza6hR4uYFhmxEqQ44ojFEZ975OxvIfAVnLwWrUA6H8p 99iIzhEXnoEJ.D9SXp7voHsBTOADD6Y1OaGSuqMuEVOHsn0DMqBulfDpfetZ s1O.PcnmArp7ZbtPGH.vkobSl.K3omz_1QV6VJ3pq.DPJUhzGHomt_QlwdG2 .5UJ0Av.zWEGbCM9NaJF4_4dUcK3UFtp37Drc7x4xQtvEWMOvRkrZq7wZ6lh i4_iq2OYKXam_8jNGlWbX0Q-- X-Yahoo-Newman-Property: ymail-3 From: "David Johnston" To: "'Thomas Kellerer'" , References: <201103241618.32280.ml-tb@emagixx.de> In-Reply-To: Subject: Re: How to retrieve column names for tables with underscores Date: Thu, 24 Mar 2011 18:52:27 -0400 Message-ID: <015701cbea76$260c9370$7225ba50$@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJeo3rFegDmJJq+wlDwSqr8866nJQFmpJvoAzhS+4ACXe/nggEtd1QWAWGjaSuSy0L+kA== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.908 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201103/49 X-Sequence-Number: 21604 >>It definitely affects how >> backslashes are interpreted, and unless the current version of the >>JDBC driver injects the 'E' escape syntax (with the 'E' prefix, >>backslash escape sequences are interpreted regardless of the setting) >>in a cavalier manner into the LIKE expression comparisons for >> getColumns() (the one I have handy doesn't seem to), you should see >>different behavior. >Regardless of the setting of standard_conforming_strings passing \_ to getColumns() always works properly. Standard conforming strings makes sequences such as '\n' be treated as literals unless you prefix an "E". When you use LIKE the '_' and '%' take on special properties (which they do not have in a regular string) - regardless of standard conforming strings since the use of LIKE means you intend to make use of those special characters. In order to avoid the special meaning of those two characters LIKE defines an escape character. Since PostgreSQL controls both, you request the escape from PostgreSQL and it provides what you need to perform the escape properly based upon the current system configuration. I hope this helps and that I'm not getting anything really wrong...