Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy marker

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy marker
Дата
Msg-id 200512271749.jBRHnDG07431@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy marker  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Andrew Dunstan wrote:
>
>
> Bruce Momjian wrote:
>
> > The big problem is that \. is also a valid
> >CSV data value (though not a valid non-CSV data value).  So, the
> >solution we came up with was to require \. to appear alone on a line in
> >CSV mode for it to be treated as end-of-copy.
> >
>
> According to the docs, that's the way to specify EOD in both text and
> CSV mode:
>
>   End of data can be represented by a single line containing just
> backslash-period.

Right, but in non-CSV mode, we allow \. at the end of any line because
it is unique so I kept that behavior.  That is not documented however.

> Your analysis regarding line_buf.len seems correct.
>
> We probably should have a regression test with \. in a CSV field.

Agreed.  My test for CSV was simple, just try loading:

    x\.
    x\.b
    \.c

all should load literally, but they fail.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #2114: (patch) COPY FROM ... end of copy marker