NOTE: This answer is tentative until someone double-checks that I didn't misunderstand any of the Hebrew and the text in the commentaries. I will edit/delete as appropriate, but I want it fact-checked by the community first.
My Hebrew is quite dodgy so I have to rely on different tools, but as far as I can tell, Malbim in his commentary on Psalms said that the verse is suggesting that those who are enemies of Jewish people and murder their children, oppress them and much worse, will suffer a horrifying fate to themselves due to actions they chose and isn't an actual call for violence:
אשרי שיאחז ונפץ את עולליך אל הסלע, כמ"ש והכרתי לבבל שם ושאר, וזה נתקים אז בשנה השנייה שעלה כורש עליה שנית והחריבה לגמרי והרג כל העם הנמצא בה:
In a similar fashion, Ibn Ezra suggests in his commentary on the Psalms that the verse is to be understood within the proper context of poetics and metaphor. He suggests that the verse is directed toward the Babylonians, who had shown cruelty by causing harm to the infants of Israel. The word "happy" is used sarcastically to describe the wickedness of their hearts. Ibn Ezra then speaks from the perspective of the Babylonians, implying that they might say the verse to God in a mocking tone, indicating their lack of understanding of divine justice.
There is also a prayer that God will bring retribution upon those who have caused harm to the Jewish infants, indicating that God will respond to their cruelty with appropriate justice.
Much like Malbim also, I think that Ibn Ezra is saying that those who are enemies of Jewish people, will suffer a terrible fate due to the evil that they're committing:
אשרי - ספר אכזריות לבם שנפצו עוללי ישראל, על כן למעלה את גמולך: