pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: d.rericha@healthcareoss.com
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #6314: The like command does not handle a long string of special chars
Date: Thu, 01 Dec 2011 12:05:19 -0600
Message-ID: <4ED76D7F0200002500043704@gw.wicourts.gov> (raw)
In-Reply-To: <E1RWAcS-0007Qi-OD@wrigleys.postgresql.org>
References: <E1RWAcS-0007Qi-OD@wrigleys.postgresql.org>

<d.rericha@healthcareoss.com> wrote:
 
> Simply set a varchar field in your db to the following string:
> !&quot;#$%&#39;()*+,-/:;=?@[\]^_`{|}~0000&amp;&lt;&gt;
 
Do you have standard_conforming_strings = on?
 
> The like command works fine up with escapes up to:
> !&quot;#$%&#39;&#39;()*+,-/:;=?@[%
> Notice, I added the % to the end. However, if you go any further -
> no matches:
> !&quot;#$%&#39;&#39;()*+,-/:;=?@[\\%
> Strangely, this works and shouldn&#39;t:
> !&quot;#$%&#39;&#39;()*+,-/:;=?@[\%
 
It is always better to include a self-contained test case.  For
example:
 
test=# set standard_conforming_strings = on;
SET
test=# create table t (v text not null);
CREATE TABLE
test=# insert into t values
('!&quot;#$%&#39;()*+,-/:;=?@[\]^_`{|}~0000&amp;&lt;&gt;');
INSERT 0 1
test=# select * from t where v like
'!&quot;#$\%&#39;()*+,-/:;=?@[\\]^_`{|}~0000&amp;&lt;&gt%'
escape '\';
                           v                            
--------------------------------------------------------
 !&quot;#$%&#39;()*+,-/:;=?@[\]^_`{|}~0000&amp;&lt;&gt;
(1 row)
 
So this is not a bug on HEAD.  What do you get when you run it?
 
-Kevin



view thread (4+ messages)  latest in thread

Message-ID: <4ED76D7F0200002500043704@gw.wicourts.gov>
Permalink:  ../4ED76D7F0200002500043704@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4ED76D7F0200002500043704@gw.wicourts.gov

 · 

reply

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-bugs@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, d.rericha@healthcareoss.com
  Subject: Re: BUG #6314: The like command does not handle a long string of special chars
  In-Reply-To: <4ED76D7F0200002500043704@gw.wicourts.gov>
  References: <E1RWAcS-0007Qi-OD@wrigleys.postgresql.org> <4ED76D7F0200002500043704@gw.wicourts.gov>

* 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