From: David Johnston <polobo@yahoo.com>
To: 'Thomas Kellerer' <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
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> (raw)
In-Reply-To: <imgdqv$3vu$1@dough.gmane.org>
References: <imfg0q$481$1@dough.gmane.org>
<201103241618.32280.ml-tb@emagixx.de>
<alpine.BSO.2.00.1103241615460.4390@leary.csoft.net>
<imgagk$h4a$1@dough.gmane.org>
<AANLkTik5mCAvTK0_KDcdr1KH8t+a0jSctDR+eyn+1Dea@mail.gmail.com>
<imgdqv$3vu$1@dough.gmane.org>
>>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...
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: polobo@yahoo.com, spam_eater@gmx.net
Subject: Re: How to retrieve column names for tables with underscores
In-Reply-To: <015701cbea76$260c9370$7225ba50$@yahoo.com>
References: <imfg0q$481$1@dough.gmane.org> <201103241618.32280.ml-tb@emagixx.de> <alpine.BSO.2.00.1103241615460.4390@leary.csoft.net> <imgagk$h4a$1@dough.gmane.org> <AANLkTik5mCAvTK0_KDcdr1KH8t+a0jSctDR+eyn+1Dea@mail.gmail.com> <imgdqv$3vu$1@dough.gmane.org> <015701cbea76$260c9370$7225ba50$@yahoo.com>
* 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