News for hackers. Stuff that matters.
Re:The surprisingly difficult problem of user-defined order ... by zzzeek on Friday January 15, 2021 @11:18PM (#25799988)
If your application only needs to deal with the list as a whole, then this doesn't matter, you load it in and build the linked list in memory using a hash lookup. Or as someone else mentioned recursive CTEs can do it too but for something small I'd just load it in and be done with it. This article is really overthinking things for the typical real world case.
Re:The surprisingly difficult problem of user-defined order ... by rileymat2 on Saturday January 16, 2021 @10:56AM (#25803012)
I largely agree with everything you said.

I thought the point of the article is it just interesting that sql seems well suited for lists, and has primitives for ordering but that within sql alone a performant ordered list is more complicated than one would expect before thinking.

Why the constraint on sql alone? In many reporting systems you can generate reports based on an sql query, so a query that pulls out the data in order can be useful in a real world use case.

Re:The surprisingly difficult problem of user-defined order ... by gregoriol on Saturday January 16, 2021 @07:33AM (#25801832)
Rebuilding a linked list can be very expansive compared to a SELECT * ORDER BY position;