pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hans Buschmann <buschmann@nidsa.net>
To: David G. Johnston <david.g.johnston@gmail.com>
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: AW: BUG #16300: Text line order corruption with COPY command
Date: Fri, 13 Mar 2020 08:49:50 +0000
Message-ID: <1584089392834.36289@nidsa.net> (raw)
In-Reply-To: <CAKFQuwZnzqUD2MapyvNO-dXknLRFp-o_x0FOTzpz+cEwrYjchg@mail.gmail.com>
References: <16300-b952db3f81f7f40d@postgresql.org>
	<CAKFQuwZnzqUD2MapyvNO-dXknLRFp-o_x0FOTzpz+cEwrYjchg@mail.gmail.com>

________________________________
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

Message-ID: <1584089392834.36289@nidsa.net>
Permalink:  ../1584089392834.36289@nidsa.net/
Also on:    postgresql.org/message-id/1584089392834.36289@nidsa.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: buschmann@nidsa.net, david.g.johnston@gmail.com
  Subject: Re: BUG #16300: Text line order corruption with COPY command
  In-Reply-To: <1584089392834.36289@nidsa.net>
  References: <16300-b952db3f81f7f40d@postgresql.org> <CAKFQuwZnzqUD2MapyvNO-dXknLRFp-o_x0FOTzpz+cEwrYjchg@mail.gmail.com> <1584089392834.36289@nidsa.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox