Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1d80ef

Browse files
committed
doc: \copy can get data values \. and end-of-input confused
Reported-by: Svante RichterDiscussion:https://postgr.es/m/fcd57e4-8f23-4c3e-a5db-2571d09208e2@beta.fastmail.comBackpatch-through: 11
1 parente29f8e7 commitd1d80ef

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎doc/src/sgml/ref/psql-ref.sgml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,10 @@ testdb=>
10861086
destination, because all data must pass through the client/server
10871087
connection. For large amounts of data the <acronym>SQL</acronym>
10881088
command might be preferable.
1089+
Also, because of this pass-through method, <literal>\copy
1090+
... from</literal> in <acronym>CSV</acronym> mode will erroneously
1091+
treat a <literal>\.</literal> data value alone on a line as an
1092+
end-of-input marker.
10891093
</para>
10901094
</tip>
10911095

‎src/bin/psql/copy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary, PGresult **res)
629629
* This code erroneously assumes '\.' on a line alone
630630
* inside a quoted CSV string terminates the \copy.
631631
* https://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org
632+
* https://www.postgresql.org/message-id/bfcd57e4-8f23-4c3e-a5db-2571d09208e2@beta.fastmail.com
632633
*/
633634
if (strcmp(buf,"\\.\n")==0||
634635
strcmp(buf,"\\.\r\n")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp