PostgreSQL custom sorting made easy
Every developer knows the pain of sorting database rows by some custom field. The easiest Example of this are DNS Records. Today i’ve come across a solution using array_position. Basically you can pass it the Order of elements you want…