After my first surgery, I found it necessary to sleep almost sitting up for the first few weeks. I stacked a bunch of pillows below me and put a rolled up blanket on either side of me, so that it would be much harder to roll over in my sleep. I am a "side sleeper", so it definitely was not comfortable, but certainly better than dealing with lots of pain the next morning.
Take care.