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

Commit36726b7

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 parent0193177 commit36726b7

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

‎src/bin/psql/copy.c

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp