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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server/ oc/src/sgml/ref/copy.sgml rc/bac ...
Date: 2003-04-21 14:42:40
Message-ID: 200304211442.h3LEgeI07330@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2003-04-21 14:54:15 pgsql-server/doc FAQ
Previous Message Tom Lane 2003-04-21 00:22:24 pgsql-server/src/backend/utils/adt float.c num ...