- |
- 39
- single quote
- '
- select '\\047'::bytea;
- '
-
-
|
92
backslash
|
32 to 126
printable
octets
- client character set representation
+ ASCII representation
select '\\176'::bytea;
~
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
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
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.
|
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