Add "(assuming standard_conforming_strings is
authorBruce Momjian
Thu, 23 Nov 2006 04:27:33 +0000 (04:27 +0000)
committerBruce Momjian
Thu, 23 Nov 2006 04:27:33 +0000 (04:27 +0000)
off)" clauses for bytea.

doc/src/sgml/datatype.sgml

index a066bb742ed7ebccd72e5c3a5beb2e8ab648630b..4bc950acf0bdf70ea2fb0ba0ebc7d3f6d18c4b2a 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
  
   Data Types
@@ -1097,15 +1097,17 @@ SELECT b, char_length(b) FROM test2;
    
 
    
-    When entering bytea values, octets of certain values
-    must be escaped (but all octet values
-    can be escaped) when used as part of a string
-    literal in an SQL statement. In general, to
-    escape an octet, it is converted into the three-digit octal number
-    equivalent of its decimal octet value, and preceded by two
-    backslashes.  shows the
-    characters that must be escaped, and gives the alternate escape
-    sequences where applicable.
+    When entering bytea values, octets of certain
+    values must be escaped (but all octet
+    values can be escaped) when used as part
+    of a string literal in an SQL statement. In
+    general, to escape an octet, it is converted into the three-digit
+    octal number equivalent of its decimal octet value, and preceded
+    by two backslashes (or one backslash if
+    standard_conforming_strings is off).
+     shows the characters
+    that must be escaped, and gives the alternate escape sequences
+    where applicable.
    
 
    
@@ -1168,24 +1170,25 @@ SELECT b, char_length(b) FROM test2;
    
 
    
-    The reason that you have to write so many backslashes, as shown in
-    , is that an input string
-    written as a string literal must pass through two parse phases in
-    the PostgreSQL server.  The first
-    backslash of each pair is interpreted as an escape character by
-    the string-literal parser and is therefore consumed, leaving the
-    second backslash of the pair.  The remaining backslash is then
-    recognized by the bytea input function as starting
-    either a three digit octal value or escaping another backslash.
-    For example, a string literal passed to the server as
-    '\\001' becomes \001 after
-    passing through the string-literal parser. The
-    \001 is then sent to the bytea
-    input function, where it is converted to a single octet with a
-    decimal value of 1.  Note that the apostrophe character is not
-    treated specially by bytea, so it follows the normal
-    rules for string literals.  (See also 
-    linkend="sql-syntax-strings">.)
+    The reason that you have to write so many backslashes, as shown
+    in , is that an input
+    string written as a string literal must pass through two parse
+    phases in the PostgreSQL server.
+    The first backslash of each pair is interpreted as an escape
+    character by the string-literal parser (assuming
+    standard_conforming_strings is off)
+    and is therefore consumed, leaving the second backslash of the
+    pair.  The remaining backslash is then recognized by the
+    bytea input function as starting either a three
+    digit octal value or escaping another backslash.  For example,
+    a string literal passed to the server as '\\001'
+    becomes \001 after passing through the
+    string-literal parser. The \001 is then sent
+    to the bytea input function, where it is converted
+    to a single octet with a decimal value of 1.  Note that the
+    apostrophe character is not treated specially by bytea,
+    so it follows the normal rules for string literals.  (See also
+    .)