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

2012-02-28 Thread Hannes Frederic Sowa

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   hs...@bfk.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


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

2012-02-27 Thread Hannes Frederic Sowa

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   hs...@bfk.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
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index e8e637b..4b582f7 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -3383,18 +3383,6 @@ cast(-44 as bit(12))   lineannotation11010100/lineannotation
/para
 
para
-Note that the backslash already has a special meaning in string literals,
-so to write a pattern constant that contains a backslash you must write two
-backslashes in an SQL statement (assuming escape string syntax is used, see
-xref linkend=sql-syntax-strings).  Thus, writing a pattern that
-actually matches a literal backslash means writing four backslashes in the
-statement.  You can avoid this by selecting a different escape character
-with literalESCAPE/literal; then a backslash is not special to
-functionLIKE/function anymore. (But backslash is still special to the
-string literal parser, so you still need two of them to match a backslash.)
-   /para
-
-   para
 It's also possible to select no escape character by writing
 literalESCAPE ''/literal.  This effectively disables the
 escape mechanism, which makes it impossible to turn off the

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers