Perhaps you are forgetting to allow for trailing blanks in the storeddata? Those are significant if you're using varchar.
regards, tom lane