Re: last row of table after csv import - Mailing list pgsql-novice

From Thomas Kellerer
Subject Re: last row of table after csv import
Date
Msg-id j7jrmb$s1f$1@dough.gmane.org
Whole thread Raw
In response to Re: last row of table after csv import  (e-letter <inpost@gmail.com>)
List 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




pgsql-novice by date:

Previous
From: e-letter
Date:
Subject: Re: last row of table after csv import
Next
From: "Daniel Staal"
Date:
Subject: Re: last row of table after csv import