Postgresql Loop Through Array Backwards Day Thomas