pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Simone Tellini <tellini@areabusiness.it>
Cc: pgsql-admin@postgresql.org
Subject: Re: restore whoes
Date: Mon, 11 Feb 2002 16:34:00 -0500
Message-ID: <15618.1013463240@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0202111626280.1903-100000@peter.localdomain>
References: <Pine.LNX.4.30.0202111626280.1903-100000@peter.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
> ISTM that this class of problem should be avoided by reading COPY input as
> a text stream rather than a binary stream on all operating systems.
> Doesn't that effectively guarantee that your program sees the end of the
> line as "\n" only, no matter how it's actually stored?

(1) No, that just guarantees that we have no control over the breakage
or recovering from it.  Our real problem is that COPY's data
representation is not newline-translation-proof; opening up an
additional place where newline translation might or might not occur
cannot fix this problem, it can only make it worse.

(2) On Unix machines, "text mode" I/O does not do anything different
from binary mode anyway.  Our problem is with pg_dump data that has
temporarily left the Unix world and been munged in transit.  We want
to be able to deal with that whether or not the local libc has ever
heard of \r\n newlines.

			regards, tom lane



view thread (30+ messages)  latest in thread

Message-ID: <15618.1013463240@sss.pgh.pa.us>
Permalink:  ../15618.1013463240@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15618.1013463240@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, pgman@candle.pha.pa.us, tellini@areabusiness.it
  Subject: Re: restore whoes
  In-Reply-To: <15618.1013463240@sss.pgh.pa.us>
  References: <Pine.LNX.4.30.0202111626280.1903-100000@peter.localdomain> <15618.1013463240@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox