Re:Features I'd Like in PostgreSQL
by danielheath on Monday January 30, 2023 @12:00AM
(#34575930)
If I were happy to rewrite the queries, I could use something like (forgetting the exact incantation)`select row_number(), rest_of_table as position partition by playlist_id order by position` to get the position column.
A DB type could be nice to hide away the adjacency list.
The other suggestion here to use fractional numbers is similar to materialized path (ltree data type in Postgres) and has been formalized to apply to hierarchies with Farey Fractions: https://sigmodrecord.org/publications/sigmodRecord/0506/p47-...