Re: last row of table after csv import

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: last row of table after csv import
Date: 2011-10-18 12:34:00
Message-ID: j7jrmb$s1f$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

e-letter, 18.10.2011 14:18:
> No interface, using command terminal to enter sql commands.
>
> The csv file of data is not ordered in any way, so I expect the
> command '\copy' to import data into a table without changing the
> relative positions of data.
>
That is a wrong assumption. There is no inherent order of the rows in a table.

Even straight after an insert the order of rows is not guaranteed to be the order in which they were inserted.
The only way to get a defined sort order is to use an ORDER BY clause when SELECTing the data.

Thomas

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel Staal 2011-10-18 13:52:56 Re: last row of table after csv import
Previous Message e-letter 2011-10-18 12:18:29 Re: last row of table after csv import