Re: unexpected data loaded into database when used COPY FROM

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "jianggq(at)fujitsu(dot)com" <jianggq(at)fujitsu(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unexpected data loaded into database when used COPY FROM
Date: 2021-07-07 15:34:06
Message-ID: 1837600.1625672046@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"jianggq(at)fujitsu(dot)com" <jianggq(at)fujitsu(dot)com> writes:
> When I used COPY FROM command on windows, I found that If the line data ends with a backslash and carriage return/newlines(\r\n),COPY FROM mishandle the line .
> As a result, there were unexpected data loaded into database.

If what you're saying is that backslash-\r-\n results in the \r being
taken as a data character, there is exactly nothing unexpected about that.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2021-07-07 15:39:02 Re: Case expression pushdown
Previous Message Domingo Alvarez Duarte 2021-07-07 15:32:49 Re: PostgreSQL-13.3 parser.y with positional references by named references