COPY: What are special characters and
how does copy load then as literals?
The
default COPY statement escape key is a backslash (\).
By preceding any special character with
an escape character, COPY interprets the character that follows literally, and copies it into the
database.
These are the special characters that you escape to load them as
literals:
- DELIMITER character (default is |)
- NULL character (Default is empty string '')
- Escape character (Default is \)
- New line and other control characters.
To use a
special character as a literal, prefix it with an escape character.
For example, to include a literal backslash (\) in the loaded data (such as when including a file path), use two
backslashes (\\).
COPY removes the escape character from the input when it loads
escaped characters.
No comments:
Post a Comment