Literals play a crucial role in enhancing the accuracy of data representation and optimizing system efficiency. See the following subsections for the introduction of various types of literals.
'Database'
is a string literal.
To include a single-quote character within a string literal, you can use two consecutive single quotes. For example, 'Stream processing''s advantages'
is a valid string literal that incorporates a single-quote character.
e
to the string literal. For example, e'abc\n\tdef'
.
The following escape sequences are supported:
Escape sequence | Interpretation |
---|---|
\b | backspace |
\f | form feed |
\n | newline |
\r | carriage return |
\t | tab |
\o, \oo, \ooo (o = 0–7) | octal byte value |
\xh, \xhh (h = 0–9, A–F) | hexadecimal byte value |
\uXXXX (x = 0–9, A–F) | 16-bit hexadecimal Unicode character value |
\UXXXXXXXX (x = 0–9, A–F) | 32-bit hexadecimal Unicode character value |