Re: Sequences part 2

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Sequences part 2
Дата
Msg-id 718af8b0-d6e9-a059-9cc8-4806d3466e13@gmx.net
обсуждение исходный текст
Ответ на RE: Sequences part 2  (Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>)
Список pgsql-general
Karl Martin Skoldebrand schrieb am 02.07.2019 um 13:20:
>>> Now I want to insert more countries, between France and Ireland.
>> 
>> That is a wrong assumption - there is no "between" for rows in a
>> relational database.
>> 
> 
> Yes, I'm fairly aware of this. However the application the 
> database table belongs to seems to rely on a specific order in the 
> database. I.e. if I just add value to the table they end up, possibly
> due to how the application is coded in an undesireable spot on the
> web page. That is why I wanted them to be inserted with the previous
> records.
There is no "order of rows" in a relational database. 

Even _if_ you squeeze the IDs of the new rows between existing ones, 
you still have no guarantee whatsoever on the order of the rows 
returned by a SELECT statement. 

The only(!) way to get a guaranteed sort order is to use ORDER BY. 

Thomas



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

Предыдущее
От: Karl Martin Skoldebrand
Дата:
Сообщение: RE: Sequences part 2
Следующее
От: Ron
Дата:
Сообщение: Re: Statistics tables not being updated anymore