If you have the option I would definitely go for the pump (I'm presuming what you're actually talking about is a PCA - Patient Controlled Analgesic). With that, you are definitely in more control for your pain relief. Of course, you are limited based on what the doctor has prescribed as far as dosage, etc., but as Jaded mentioned, with the PCA pump, you don't have to wait for a nurse to come in and give you a shot - which can sometimes be a long wait, depending on how busy they are with other patients and whether they are in the midst of a shift change, etc.
I've had the PCA pump several times after surgeries, and I've always found them to work better than shots for pain. Another benefit of them is that since you are normally permitted to "hit your button" every several minutes (usually between 6-9 minutes), you are also getting a more consistent pain relief. With the shots, you can experience more up and down pain control rather than the steadier control you can get with the pump.
Best of luck with your surgery and I hope whichever method you choose, your pain is well controlled.
I think the pump would probably be better as nurses can be really difficult to deal with regarding pain. I've never had surgery before, though, so I really can't say for sure.