aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-08-17 10:00:06 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-08-17 10:00:06 +0300
commite9a79c220bf55e179bb8e0c37fca1239e0fb3b0b (patch)
tree16935124ba9ed6fe2904411c525fc22ea11f573d
parent6f8127b7390119c21479f5ce495b7d2168930e82 (diff)
downloadpostgresql-e9a79c220bf55e179bb8e0c37fca1239e0fb3b0b.tar.gz
postgresql-e9a79c220bf55e179bb8e0c37fca1239e0fb3b0b.zip
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
-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 14cd437da0a..4624c8f4c98 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -636,12 +636,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>
@@ -674,6 +674,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