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

Commita5bee67

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 parent31a89dd commita5bee67

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
@@ -1082,6 +1082,10 @@ testdb=>
10821082
destination, because all data must pass through the client/server
10831083
connection. For large amounts of data the <acronym>SQL</acronym>
10841084
command might be preferable.
1085+
Also, because of this pass-through method, <literal>\copy
1086+
... from</literal> in <acronym>CSV</acronym> mode will erroneously
1087+
treat a <literal>\.</literal> data value alone on a line as an
1088+
end-of-input marker.
10851089
</para>
10861090
</tip>
10871091

‎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 ((linelen==3&&memcmp(fgresult,"\\.\n",3)==0)||
634635
(linelen==4&&memcmp(fgresult,"\\.\r\n",4)==0))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp