Postgresql Loop Through Array Backwards E