Re: last row of table after csv import

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: last row of table after csv import
Дата
Msg-id j7jrmb$s1f$1@dough.gmane.org
обсуждение исходный текст
Ответ на Re: last row of table after csv import  (e-letter <inpost@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: e-letter
Дата:
Сообщение: Re: last row of table after csv import
Следующее
От: "Daniel Staal"
Дата:
Сообщение: Re: last row of table after csv import