BUG #2221: Bad delimiters allowed in COPY ... TO

Поиск
Список
Период
Сортировка
От David Fetter
Тема BUG #2221: Bad delimiters allowed in COPY ... TO
Дата
Msg-id 20060129215008.A5965F0B00@svr2.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2221: Bad delimiters allowed in COPY ... TO  (David Fetter <david@fetter.org>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2221
Logged by:          David Fetter
Email address:      david@fetter.org
PostgreSQL version: all
Operating system:   all
Description:        Bad delimiters allowed in COPY ... TO
Details:

This came up while I was testing my pg_dump "specify DELIMITER AS and/or
NULL AS" patch.

Below is a repro using newline.  A similar problem happens when you specify
the delimiter as a backslash.  Should COPY simply not allow these
delimiters?  What about carriage return?  Just in general, what bytes other
than null ought COPY to reject out of hand?

Also, what regression tests do we want to put in in order to ensure that
COPY ... TO generates output that COPY ... FROM can understand?

CREATE TABLE pqxxevents (
    "year" integer,
    event text
);

COPY pqxxevents ("year", event) FROM stdin DELIMITER AS '^M';
2010^MOdyssey Two
2038^Mtime_t overflow
1971^Mjtv
1981^MC:\\>
1997^MAsian crisis
1999^M\N
1978^Mbloody\t\tcold
1989^MOde an die Freiheit
2001^MNew millennium
2001^M'911' WTC attack
2001^MA Space Odyssey
2002^Mlibpqxx
3001^MFinal Odyssey
\.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2218: Variables selected in VIEWs under different names break queries using those views
Следующее
От: David Fetter
Дата:
Сообщение: Re: BUG #2221: Bad delimiters allowed in COPY ... TO