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

Commit7186596

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 parentbf7584e commit7186596

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
@@ -1075,6 +1075,10 @@ testdb=>
10751075
destination, because all data must pass through the client/server
10761076
connection. For large amounts of data the <acronym>SQL</acronym>
10771077
command might be preferable.
1078+
Also, because of this pass-through method, <literal>\copy
1079+
... from</literal> in <acronym>CSV</acronym> mode will erroneously
1080+
treat a <literal>\.</literal> data value alone on a line as an
1081+
end-of-input marker.
10781082
</para>
10791083
</tip>
10801084

‎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