Neil Conway wrote:
> On Sat, 2003-04-19 at 15:55, Bruce Momjian - CVS wrote:
> > Add pipe parameter to COPY function to allow proper line termination.
> >
>
> <para>
> - Note that the end of each row is marked by a Unix-style newline
> - (<quote><literal>\n</></>). Presently, <command>COPY FROM</command> will not behave as
> - desired if given a file containing DOS- or Mac-style newlines.
> - This is expected to change in future releases.
> + <command>COPY TO</command> will terminate each row with a Unix-style
> + newline (<quote><literal>\n</></>), or carriage return/newline
> + ("\r\n") on MS Windows. <command>COPY FROM</command> can handle lines
> + ending with newlines, carriage returns, or carriage return/newlines.
> </para>
> </refsect2>
>
> You might want to clarify that it's the OS of the server (I assume) that
> determines the line endings used by COPY TO.
Yes, I did think of that. The issue is that COPY only outputs files on
to the server machine, so I figured it was clear, but you are right, it
is a good idea to make it clear in the docs.
COPY to STDOUT/STDIN will be controlled by the client end-of-line
because those files are opened in text mode by the client, I think.
Doc patch attached.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Index: copy.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/copy.sgml,v
retrieving revision 1.43
diff -c -c -r1.43 copy.sgml
*** copy.sgml 19 Apr 2003 19:55:37 -0000 1.43
--- copy.sgml 20 Apr 2003 01:50:08 -0000
***************
*** 363,370 ****
<para>
<command>COPY TO</command> will terminate each row with a Unix-style
newline (<quote><literal>\n</></>), or carriage return/newline
! ("\r\n") on MS Windows. <command>COPY FROM</command> can handle lines
! ending with newlines, carriage returns, or carriage return/newlines.
</para>
</refsect2>
--- 363,371 ----
<para>
<command>COPY TO</command> will terminate each row with a Unix-style
newline (<quote><literal>\n</></>), or carriage return/newline
! ("\r\n") for servers running MS Windows.
! <command>COPY FROM</command> can handle lines ending with newlines,
! carriage returns, or carriage return/newlines.
</para>
</refsect2>