Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks

Поиск
Список
Период
Сортировка
От lou@paprikash.com
Тема Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks
Дата
Msg-id 4752F0F4.23452.1DF08399@lou.paprikash.com
обсуждение исходный текст
Ответ на Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> "Lou Duchez" <lou@paprikash.com> writes:
> > My copy of PostgreSQL has standard_conforming_strings set to "on", and when
> > I attempt to pg_dump tables that have strings containing CR/LFs, the data
> > dumps in a format that psql cannot then reload.
>
> It works fine here.  Please provide a *complete* example of what you
> are doing.
>
>             regards, tom lane
>

Hello,

Here is a complete example.  I have two Windows servers, one with PostgreSQL 8.2.5, the
other with 8.3 beta 3.  Both have standard_conforming_strings set to "on".  My "test"
database is UTF8 on each server.  I perform the following steps on each server:



1)    Using pgAdmin III version 1.8, I create a table in my "test" database:

CREATE TABLE testtable
(
   column1 character varying(200) DEFAULT '',
    PRIMARY KEY (column1)
) WITH (OIDS=FALSE);



2)    Again using pgAdmin, I add two rows to the table:

insert into testtable (column1) values ('This
is
a
multi
row
string'),
('This
is
another
multi
row
string');



3)    Then I run the following pg_dump command:

pg_dump -U postgres -E LATIN1 -t testtable testdatabase



The two versions of PostgreSQL produce slightly different results.  8.2.5 generates the
following "COPY" command:


COPY testtable (column1) FROM stdin;
This\nis\na\nmulti\nrow\nstring
This\nis\nanother\nmulti\nrow\nstring
\.



8.3 beta 3 generates the following "COPY" command:

COPY testtable (column1) FROM stdin;
This\
is\
a\
multi\
row\
string
This\
is\
another\
multi\
row\
string
\.



The 8.3 version, with the unescaped line breaks, confuses the heck out of psql.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3795: pg_dump is mis-dumping columns containing line breaks