Postgresql Loop Through Array Backwards Generator Text