Possibly the latest of all the Psalms, written at the time of exile, remembering Zion in Babylon.
v1: Time of mourning and sorrow; Judah's sin had led to the Babylonian captivity, Ps 120.5; dwelling amongst the ungodly, but this was the result of living like the ungodly.
v2-3: Mocking to be endured, "Sing us one of the songs of Zion!" Such hymns of praise reminded them of past blessings, and brought sorrow of heart, see Ezra 3.12-13. Jewish songs were clearly known beyond the borders of Israel; this was a characteristic of their worship.
v4: Remembrance without joy and mirth; the people had turned from God, and now suffered outside His blessing. They could not sing His songs.
v5: More important to remember Jerusalem than to sing; songs without real faith are meaningless; compare 1 Cor 13.1-3.
v6: It may have been that suffering in Babylon caused the people to turn their minds back to Jerusalem. To dwell in a pagan kingdom would make the people appreciate the privilege of serving the true God.
v7: Blatant persecution from Edom, see Obad 10-14. Like Babylon, Edom was guilty of physical cruelty.
See 1 Kings 8.48; the Jew in exile, like Daniel, turned his eyes to Jerusalem, even as we turn our eyes to Christ.
v8-9: Cruelty of Babylon to be returned upon her own head, Jer 50.18. C.S.Lewis comments that these verses present an allegory of ungodly attitudes that develop in our hearts; we should deal with them early, before they grow.