AW: BUG #16300: Text line order corruption with COPY command

Поиск
Список
Период
Сортировка
От Hans Buschmann
Тема AW: BUG #16300: Text line order corruption with COPY command
Дата
Msg-id 1584089392834.36289@nidsa.net
обсуждение исходный текст
Ответ на Re: BUG #16300: Text line order corruption with COPY command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: BUG #16300: Text line order corruption with COPY command  (Francisco Olarte <folarte@peoplecall.com>)
Re: BUG #16300: Text line order corruption with COPY command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs


Von: David G. Johnston <david.g.johnston@gmail.com>
Gesendet: Donnerstag, 12. März 2020 21:42
An: Hans Buschmann; PostgreSQL mailing lists
Betreff: Re: BUG #16300: Text line order corruption with COPY command
 


Thank you for the quick reply.

 

When looking into the documentation I find under SQL COPY command:

 

"If a column list is specified, COPY TO copies only the data in the specified columns to the file.
For COPY FROM, each field in the file is inserted, in order, into the specified column.
Table columns not specified in the COPY FROM column list will receive their default values. "

 

So I expected the insertion in order as said above.

 

In my opinion it is essential to preserve the order of textfile input in COPY FROM. This also holds true when copying from another source like a program, where often it is not practicable to add an orderable column on input.

 

Not preserving (and rendering on a select) the order makes the COPY FROM mostly unusable for cases where the order must be preserved. (Think of XML, JSON, Source code, Log files, Disassembly etc.).

 

The size of such kind of files can it make also impractible to take the mentioned circumventing methods you provided.

 

I have not inspected the resulting tuple orders on the physical file.

 

I will try to nail down the first occurence of the disordering during the import by comparing import and export.

 

My concern also goes to pg_dump and friends, which could change such not natural orderable tables through pg_dump/pg_restore.

 

Hans Buschmann

 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16300: Text line order corruption with COPY command
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #16300: Text line order corruption with COPY command