Several of the Psalms contain what are often described as "deprecatory" sections - bits where the Psalmist is praying for God to break the teeth of / hurt / defeat enemies. And yes, I know Psalm 137:8-9 is worse than that.
Anyhow, Dale Ralph Davis has an interesting insight on this, while reflecting on how David treated Saul. David, of course, is credited as having written many of the Psalms, some even before he came king. Saul was David's predecessor as king, and spent several years trying to kill him because he was worried that David would take over. David had quite a few opportunities to kill Saul (e.g. 1 Samuel 24), but made a point of not taking them.
Davis points out two important features of deprecatory Psalms:
- The Psalmist wanted nasty things to happen to people
- The Psalmist didn't do them, but left vengeance to God
Should our attitude be different to 1? Maybe. In some cases, it is quite understandable to feel that way though. On a trivial level, I know I have briefly wanted nasty things to happen to people who (for example) turn left across the path I was trying to ride on a bike, in at least one case forcing me to skid off the road to avoid being hit. On a more serious level, the author of Psalm 137 had almost certainly seen the brutal destruction of his home city at the hands of the Babylonians, who had in all probability killed infants he knew by throwing them against rocks. In such situations, being angry and wanting nasty things to happen to people is understandable.
But given that anger, what should we do with it? Well, the message of the deprecatory Psalms is that we should pray about it and we should leave it to God to sort out. Revenge is not our job.