Re: [BUGS] \copy produces CSV output that cannot be read by \copy - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] \copy produces CSV output that cannot be read by \copy
Date
Msg-id 1473.1501951948@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] \copy produces CSV output that cannot be read by \copy  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [BUGS] \copy produces CSV output that cannot be read by \copy
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> The format produced by COPY OUT looks fine to me, and can be reloaded
> with a plain COPY (not \copy). And you may be interested in this bit
> from src/bin/psql/copy.c:
>                     /*
>                      * This code erroneously assumes '\.' on a line alone
>                      * inside a quoted CSV string terminates the \copy.
>                      *
> http://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org
>                      */

I wonder if it would improve matters to check for "\." only when
copystream == pset.cur_cmd_source, that is, only when the copy data
is inlined into the SQL stream.  That would create an inconsistency
between inline and out-of-line data, but it might be a reasonable
thing to do anyway.
        regards, tom lane


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [BUGS] \copy produces CSV output that cannot be read by \copy
Next
From: Andres Freund
Date:
Subject: Re: [BUGS] [BUG] pg9.4.10 Logical decoding did not get the correctoldtuplelen