Will I get any medicine for pain when I go for the prostatectomy?

Yes. This surgical procedure done in different ways most of them you will given pain medications for it.
You should. I do not think any urologist would perform a prostatectomy without prescribing pain medication. An exception might be acupuncture, but this, if used, would be equivalent of pain medication.