Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1BLYNE45143 for ; Mon, 11 Feb 2002 16:34:23 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g1BLY0f15621; Mon, 11 Feb 2002 16:34:00 -0500 (EST) To: Peter Eisentraut cc: Bruce Momjian , Simone Tellini , pgsql-admin@postgresql.org Subject: Re: restore whoes In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Mon, 11 Feb 2002 16:29:30 -0500" Date: Mon, 11 Feb 2002 16:34:00 -0500 Message-ID: <15618.1013463240@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200202/137 X-Sequence-Number: 3294 Peter Eisentraut 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