From 22e22a5208deb741abcd612f5e1cfe7b674ca745 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 21 Nov 2001 21:12:34 +0000 Subject: [PATCH] Spelling and grammatical corrections. --- doc/src/sgml/datatype.sgml | 41 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 2695033ecb..c7c0d740a9 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1005,10 +1005,9 @@ SELECT b, char_length(b) FROM test2; octet values may 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 preceeded by two - backslashes. Octets with the decimal values 39 (single quote), and 92 - (backslash), have special alternate escape sequences. Details are in - . + equivalent of its decimal octet value, and preceded by two + backslashes. Some octet values have alternate escape sequences, as + shown in . @@ -1059,7 +1058,7 @@ SELECT b, char_length(b) FROM test2; octet and backslash are more than one character. Bytea output octets are also escaped. In general, each non-printable octet decimal value is converted into - its equivalent three digit octal value, and preceeded by one backslash. + its equivalent three digit octal value, and preceded by one backslash. Most printable octets are represented by their standard representation in the client character set. The octet with decimal value 92 (backslash) has a special alternate output representation. @@ -1081,14 +1080,6 @@ SELECT b, char_length(b) FROM test2; - - 39 - single quote - ' - select '\\047'::bytea; - ' - - 92 backslash @@ -1108,7 +1099,7 @@ SELECT b, char_length(b) FROM test2; 32 to 126 printable octets - client character set representation + ASCII representation select '\\176'::bytea; ~ @@ -1119,12 +1110,12 @@ SELECT b, char_length(b) FROM test2; SQL string literals (input strings) must be - preceeded with two backslashes due to the fact that they must pass + preceded with two backslashes due to the fact that they must pass through two parsers in the PostgreSQL backend. The first backslash is interpreted as an escape character by the string literal parser, and therefore is consumed, leaving the octets that follow. - The second backslash is recognized by bytea input function - as the prefix of a three digit octal value. For example, a string + The remaining backslash is recognized by the bytea input + function as the prefix of a three digit octal value. For example, a string literal passed to the backend as '\\001' becomes '\001' after passing through the string literal parser. The '\001' is then sent to the @@ -1135,11 +1126,11 @@ SELECT b, char_length(b) FROM test2; For a similar reason, a backslash must be input as '\\\\' (or '\\134'). The first - and third backslashes are interpreted as escape octets by the - string literal parser, and therefore are consumed, leaving the - second and forth backslashes untouched. The second and forth - backslashes are recognized by the bytea input function - as a single backslash. For example, a string literal passed to the + and third backslashes are interpreted as escape characters by the + string literal parser, and therefore are consumed, leaving two + backslashes in the string passed to the bytea input function, + which interprets them as representing a single backslash. + For example, a string literal passed to the backend as '\\\\' becomes '\\' after passing through the string literal parser. The '\\' is then sent to the bytea input @@ -1169,7 +1160,7 @@ SELECT b, char_length(b) FROM test2; line feeds and carriage returns if your interface automatically translates these. Or you may have to double up on backslashes if the parser for your language or choice also treats them as an - escape octet. + escape character. @@ -1246,7 +1237,7 @@ SELECT b, char_length(b) FROM test2; A binary string literal is comprised of an even number of - hexidecimal digits, in single quotes, preceeded by X, + hexadecimal digits, in single quotes, preceded by X, e.g. X'1a43fe' A binary string literal is comprised of octets escaped according to the rules shown in -- GitLab