Search Postgresql Archives

Re: Sequences part 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux