Re: restore whoes

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: Simone Tellini <tellini(at)areabusiness(dot)it>, pgsql-admin(at)postgresql(dot)org
Subject: Re: restore whoes
Date: 2002-02-11 19:59:52
Message-ID: 200202111959.g1BJxqH07105@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > 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.
>
> In the examples given, the error didn't show up till later rows, in
> fields where there was no \r anywhere.

Hard to imagine why a failure would occur on anything but the first row.
The original poster had \.0, which was some other issue. I don't
remember seeing those examples.

> > 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.
>
> There *is no* foolproof solution with the current data representation
> (and your idea of throwing untrustworthy error messages is certainly not
> foolproof). What we need to do is migrate to a new data representation.
> Fortunately, it's nearly there already, since \ r and \ n sequences are
> already supported by COPY IN.

We clearly should be outputting \r and \n from COPY by default.

Input is the issue. We are foolproof it people don't munge there
original files. The question is how many people are munging them vs. how
many people are creating COPY files on their own (and need to add
mapping for \r), or have COPY files from older versions of PostgreSQL.
I think the latter group is much larger.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-02-11 20:30:36 Re: restore whoes
Previous Message Tom Lane 2002-02-11 19:24:18 Re: restore whoes