Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1BJI4E90407 for ; Mon, 11 Feb 2002 14:18:04 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g1BJHsi03274; Mon, 11 Feb 2002 14:17:54 -0500 (EST) From: Bruce Momjian Message-Id: <200202111917.g1BJHsi03274@candle.pha.pa.us> Subject: Re: restore whoes In-Reply-To: <11287.1013454913@sss.pgh.pa.us> To: Tom Lane Date: Mon, 11 Feb 2002 14:17:54 -0500 (EST) CC: Simone Tellini , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL96 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200202/127 X-Sequence-Number: 3286 Tom Lane wrote: > Bruce Momjian writes: > > Another option is to just print the sed command that would strip off the > > \r from the end of the line. > > You keep on assuming that a mechanical fix is possible when a file's > been munged. It is *NOT*. There is no reliable way to tell whether a > \r was part of the original data or was added by a newline converter. > We will not do anyone a service by printing a message that falsely > suggests they don't need to think carefully about how to reconstruct > their data. > > The only thing worse than no error message is a misleading error > message. Well, if the COPY fails on the last value of the first row, and that value has a trailing \r, we can be pretty sure. I don't see how your solution make it fool-proof, except by requiring every COPY file, old and new, and created, to have CR as \r. That seems too heavy-handed the other way. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026