Use of backslash in tsearch2

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: teodor(at)sigaev(dot)ru
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Use of backslash in tsearch2
Date: 2006-08-22 00:04:01
Message-ID: 200608220004.k7M041804370@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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.

--
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 Content-Type Size
/bjm/diff text/x-diff 1.3 KB
/rtmp/regression.diffs text/x-diff 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2006-08-22 00:08:13 Dumping old contrib code update
Previous Message Tom Lane 2006-08-21 23:45:36 Re: [HACKERS] Unable to post to -patches (was: Visual C++ build files)

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-08-22 00:15:28 Re: Use of backslash in tsearch2
Previous Message Tom Lane 2006-08-21 23:45:36 Re: [HACKERS] Unable to post to -patches (was: Visual C++ build files)