Good evening - I'm Dr. Sara. I'm a licensed veterinarian who works exclusively with cats and dogs.
With constipation, you can try adding a teaspoon of canned pumpkin to your pet's meal - this tends to help get things moving. However, I will caution you that it can also cause the stool to be too loose, especially if they aren't really constipated. If they've not been eating well for a few days, and especially if they went a day or two without eating at all, due to any illness, it's not unusual at all for them to skip a couple of days bowel movements. If they aren't straining to poop, I'm cautious with giving laxatives because causing diarrhea in a pet that's already ill can cause more harm than good.
With pinched nerves or other spinal pain, sometimes they will just be voluntarily holding it because it's painful for them to posture and push properly. In that case, they're not likely to harm themselves. There are a lot of other variables too, like their overall health status and other chronic diseases. Kidney disease, for instance, can cause dehydration that can lead to constipation, but your typical osmotic diuretics can cause diarrhea, further complicating the diarrhea.
Another thing you can do to help get things moving, IF your vet hasn't put him on a strict rest for his pinched nerve, is to get him up and walking around a bit, and potentially do a little gentle belly massage. Some cats are cool with the belly massage, others not so much - you just have to test it out ;) obviously if they object, I don't recommend continuing to try.
Please let me know what follow up questions I can answer for you!