I have IBS and what was thought to be ulcerative colitis until yesterday. I have solitary rectal ulcer syndrome which is linked to the IBS. I have a lot of constipation and diaharea. When I strain too much or go to the toilet too much the rectum area gets inflamed and causes an ulcer. I have treatment in the form of prednisilone suppositories.
The ulcers can be caused by the way you strain aswell as everyones anatomy is different. If you get constipated a lot, the pressure alone can cause the rectal ulcers.
If you have what I have you definatley don't need surgery but be sure that you get a proper diagnosis.
Good luck and let me know how you get on