Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping

Lists: pgsql-hackers
From: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Florian Weimer <fweimer(at)bfk(dot)de>
Subject: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-27 15:17:58
Message-ID: 4F4B9EA6.1040409@bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi!

As with recent changes to `standard_conforming_strings' the paragraph
about backslash escaping in the description of `LIKE' is only confusing.
Thus I attached a patch to remove it.

Greetings,

Hannes

--
Hannes Sowa <hsowa(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

Attachment Content-Type Size
like-backslash-remove-paragrah.patch text/x-patch 1.2 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Florian Weimer <fweimer(at)bfk(dot)de>
Subject: Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-27 15:30:36
Message-ID: CA+TgmoY6-YL1OQ34709yTZbt4Onr+pSDUi95x2YSP4iO0iVBrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 27, 2012 at 10:17 AM, Hannes Frederic Sowa <hsowa(at)bfk(dot)de> wrote:
> As with recent changes to `standard_conforming_strings' the paragraph about
> backslash escaping in the description of `LIKE' is only confusing. Thus I
> attached a patch to remove it.

I think I agree with removing this paragraph; it made sense when
standard_conforming_strings=off was the default, but that's not so
anymore. We could come up with some alternative text to insert here
but I think that might be unnecessarily long-winded.

Other opinions?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Florian Weimer <fweimer(at)bfk(dot)de>
Subject: Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-27 15:32:23
Message-ID: 13482.1330356743@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hannes Frederic Sowa <hsowa(at)bfk(dot)de> writes:
> As with recent changes to `standard_conforming_strings' the paragraph
> about backslash escaping in the description of `LIKE' is only confusing.
> Thus I attached a patch to remove it.

The para is still relevant if you don't have standard_conforming_strings
on. It could probably use work but I don't think simply removing it
is appropriate.

regards, tom lane


From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-27 16:00:47
Message-ID: 824nucnu4w.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

* Tom Lane:

> Hannes Frederic Sowa <hsowa(at)bfk(dot)de> writes:
>> As with recent changes to `standard_conforming_strings' the paragraph
>> about backslash escaping in the description of `LIKE' is only confusing.
>> Thus I attached a patch to remove it.
>
> The para is still relevant if you don't have standard_conforming_strings
> on.

And if you aren't using parametrized queries. The old text is a bit
misleading even with standard_conforming_strings set to off. It is
technically correct because it refers to the SQL statement parser which
is run on parameters, but this seems a pretty fine distinction.

--
Florian Weimer <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>, pgsql-hackers(at)postgresql(dot)org, Florian Weimer <fweimer(at)bfk(dot)de>
Subject: Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-27 23:10:39
Message-ID: 21142.1330384239@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Feb 27, 2012 at 10:17 AM, Hannes Frederic Sowa <hsowa(at)bfk(dot)de> wrote:
>> As with recent changes to `standard_conforming_strings' the paragraph about
>> backslash escaping in the description of `LIKE' is only confusing. Thus I
>> attached a patch to remove it.

> I think I agree with removing this paragraph; it made sense when
> standard_conforming_strings=off was the default, but that's not so
> anymore. We could come up with some alternative text to insert here
> but I think that might be unnecessarily long-winded.

On a closer look, I see three different places in the
functions-matching.html page that talk about doubling backslashes, of
which this one might be the least bogus, since it at least provides
a cross-reference to someplace where you would read about
standard_conforming_strings.

I suggest replacing the first and third cases with something along the
lines of

Note: if you have standard_conforming_strings turned off, any
backslashes you write in literal string constants will need to be
doubled. See Section 4.1.2.1 for more information.

The second case is just a parenthetical comment and perhaps could be
removed.

regards, tom lane


From: Hannes Frederic Sowa <hsowa(at)bfk(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Florian Weimer <fweimer(at)bfk(dot)de>
Subject: Re: [PATCH] Documentation: remove confusing paragraph about backslash escaping
Date: 2012-02-28 09:45:06
Message-ID: 4F4CA222.2020509@bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 02/28/2012 12:10 AM, Tom Lane wrote:
> I suggest replacing the first and third cases with something along the
> lines of
>
> Note: if you have standard_conforming_strings turned off, any
> backslashes you write in literal string constants will need to be
> doubled. See Section 4.1.2.1 for more information.
>
> The second case is just a parenthetical comment and perhaps could be
> removed.

Definitely OK by me. Thanks for looking into this!

--
Hannes Sowa <hsowa(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99