Before Inserting Id Priority 1 . 1 2 . 2 3 . 3 After Inserting Id: 4, Priority 2 Id Priority 1 . 1 4 . 2 2 . 3 3 . 4 fairly new to postgres, and i have a table with a column named priority. this column should have unique values, and if you attempt to give a row a priority that already exists, it would basically insert it with that priority, and decrement all the priorities that are <= by one to accommodate it.
is there a term for this sort of behavior? i know it will involve a column with unique values, but are there any model constraints i can introduce to enable this sort of behavior? or do i need to manually code an algorithm to do this and account for all edge cases.