The backslash sequences, including \123 and \x12 escapes, are interpreted
after encoding conversion. The docs failed to mention that.
Backpatch to all supported versions.
Reported-by: Andreas Grob
Discussion: https://www.postgresql.org/message-id/17142-
9181542ca1df75ab%40postgresql.org
|
\digits
Backslash followed by one to three octal digits specifies
- the character with that numeric code
+ the byte with that numeric code
|
\xdigits
Backslash x followed by one or two hex digits specifies
- the character with that numeric code
+ the byte with that numeric code
or vice versa).
+ All backslash sequences are interpreted after encoding conversion.
+ The bytes specified with the octal and hex-digit backslash sequences must
+ form valid characters in the database encoding.
+
+
COPY TO will terminate each row with a Unix-style
newline (\n
). Servers running on Microsoft Windows instead