Postgresql Loop Through Array Backwards 3