Skip site navigation (1) Skip section navigation (2)

Re: Use of backslash in tsearch2

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: teodor(at)sigaev(dot)ru, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Use of backslash in tsearch2
Date: 2006-08-22 00:48:06
Message-ID: 200608220048.k7M0m6x10224@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Bruce Momjian wrote:
> Bruce Momjian wrote:
> > 
> > I backed out the patch, attached, and it has fixed the regression
> > problem.  What has me confused is that is looks like it is checking for
> > ', then putting \, which doesn't make a lot of sense, but the regression
> > output is corrected, so I just don't get it.  Here is an example:
> > 
> > 	test=> SELECT E'''1 \\''2''';
> > 	 ?column?
> > 	----------
> > 	 '1 \'2'
> > 
> > My only guess is that the output is somehow a single-quoted string
> > itself, and in fact \' should become ''.  Is that right?  Basically they
> > are doing \' in their output, and it should be doing '', but then the
> > query above would be wrong and shouldn't be using \'.
> 
> As part of the move to support standard-conforming strings and treat
> backslash literally, I reviewed the tsearch2 code and found two place
> that seemed to use \' rather than '', and generated the attached patch. 
> ('' is standards conforming.)  However, when I fixed the code, the
> regression tests failed.
> 
> Teodor, are the new attached regression results correct?  If so, I will
> apply the patch and update the expected file.

Updated patch attached.  The previous one was reversed.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Attachment: /pgpatches/tsearch2
Description: text/x-diff (1.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-08-22 00:52:04
Subject: Open 8.2 items
Previous:From: mdeanDate: 2006-08-22 00:45:10
Subject: Re: ISBN/ISSN/ISMN/EAN13 module

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-08-22 00:52:47
Subject: Re: Contrib module to examine client certificate
Previous:From: Bruce MomjianDate: 2006-08-22 00:28:27
Subject: Re: Use of backslash in tsearch2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group