Re: restore whoes

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: restore whoes
Дата
Msg-id 200202111959.g1BJxqH07105@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: restore whoes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: restore whoes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: restore whoes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: restore whoes