summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorHeikki Linnakangas2021-08-17 07:00:06 +0000
committerHeikki Linnakangas2021-08-17 08:18:06 +0000
commitb889d6c7196d120c9e9a357dea5cd77d68018600 (patch)
tree789a9c750c4ed6c7f1dcfff2dfaa75296d1fb5f7 /doc/src
parentd392e86fa9c4ef5170eebf700d81f77ede4363ad (diff)
doc: \123 and \x12 escapes in COPY are in database encoding.
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/copy.sgml10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 7c5421268de..1e57328ca7d 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -615,12 +615,12 @@ COPY <replaceable class="parameter">count</replaceable>
<row>
<entry><literal>\</literal><replaceable>digits</replaceable></entry>
<entry>Backslash followed by one to three octal digits specifies
- the character with that numeric code</entry>
+ the byte with that numeric code</entry>
</row>
<row>
<entry><literal>\x</literal><replaceable>digits</replaceable></entry>
<entry>Backslash <literal>x</literal> followed by one or two hex digits specifies
- the character with that numeric code</entry>
+ the byte with that numeric code</entry>
</row>
</tbody>
</tgroup>
@@ -653,6 +653,12 @@ COPY <replaceable class="parameter">count</replaceable>
</para>
<para>
+ 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.
+ </para>
+
+ <para>
<command>COPY TO</command> will terminate each row with a Unix-style
newline (<quote><literal>\n</literal></quote>). Servers running on Microsoft Windows instead
output carriage return/newline (<quote><literal>\r\n</literal></quote>), but only for