Syntax
'characters'
Semantics
characters is an arbitrary sequence of UTF8 characters bounded by single quotes (').
Using Single Quotes in a String
The SQL standard way of writing a single-quote character within a string constant is to write two adjacent single quotes. for example:
'Chester''s gorilla'
Vertica SQL also allows single quotes to be escaped with a backslash (\). For example:
'Chesters\'s gorilla'
C-Style Backslash Escapes
Vertica SQL also supports the following C-style backslash escapes. Any other character following a backslash is taken literally.
\\
is a backslash\b
is a backspace\f
is a form feed\n
is a newline\r
is a carriage return\t
is a tab\
xxx, where xxx
is an octal number representing a byte with the corresponding code. (It is your responsibility that the byte sequences you create are valid characters in the server character set encoding. The character with the code zero cannot be in a string constant.) Notes
Examples
=> SELECT 'This is a string';
?column?
------------------
This is a string
(1 row)