Re: pgsql-server/ oc/src/sgml/ref/copy.sgml rc/bac ... - Mailing list pgsql-committers

From Bruce Momjian
Subject Re: pgsql-server/ oc/src/sgml/ref/copy.sgml rc/bac ...
Date
Msg-id 200304211442.h3LEgeI07330@candle.pha.pa.us
Whole thread Raw
In response to Re: pgsql-server/ oc/src/sgml/ref/copy.sgml rc/bac ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql-server/ oc/src/sgml/ref/copy.sgml rc/bac ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > 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.
>
> Actually, I was going to question you on that before.  AFAICT, the
> just-committed code will *only* send LF newlines during COPY TO STDOUT,
> independent of the server's OS, the client's OS, or anything else.

Right.  In my initial testing, I noticed that when I was sending \r\n to
the client for STDOUT, the regression tests hung, so I added code to
test/pass pipe and force \n for STDIN/STDOUT.

> This is perhaps justifiable on the grounds that "the FE/BE protocol
> spec says LF and not anything else", and I didn't complain because
> I assumed that was your thinking.  But your response to Neil doesn't

It is my thinking.  The server could be Win32 and the client could be
unix, or the opposite.  I see no reason to allow handling of any line
terminator at that level.

> suggest that you're thinking that way.  What exactly do you have in
> mind here?  Certainly the client is not going to determine the
> newline format for COPY TO STDOUT unless it does translation.

My idea was that if the client opens a file to dump the STDOUT data, it
will opened in text mode, and that will have \r\n for Win32 and \n for
Unix.

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


pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql-server/src/backend/utils/adt float.c num ...
Next
From: momjian@postgresql.org (Bruce Momjian - CVS)
Date:
Subject: pgsql-server/doc FAQ