A Psalm. A Song at the dedication of the house of David.
1 I will extol You, O Lord, for You have lifted me up,
And have not let my foes rejoice over me.
2 O Lord my God, I cried out to You,
And You healed me.
3 O Lord, You brought my soul up from the grave;
You have kept me alive, that I should not go down to the pit.
4 Sing praise to the Lord, you saints of His,
And give thanks at the remembrance of His holy name.
5 For His anger is but for a moment,
His favor is for life;
Weeping may endure for a night,
But joy comes in the morning.
6 Now in my prosperity I said,
“I shall never be moved.”
7 Lord, by Your favor You have made my mountain stand strong;
You hid Your face, and I was troubled.
8 I cried out to You, O Lord;
And to the Lord I made supplication:
9 “What profit is there in my blood,
When I go down to the pit?
Will the dust praise You?
Will it declare Your truth?
10 Hear, O Lord, and have mercy on me;
Lord, be my helper!”
11 You have turned for me my mourning into dancing;
You have put off my sackcloth and clothed me with gladness,
12 To the end that my glory may sing praise to You and not be silent.
O Lord my God, I will give thanks to You forever.
Perhaps written on the occasion of the events recorded in 2 Samuel 5:11-12, immediately following the capture of Jerusalem. Then Hiram king of Tyre sent messengers to David, and cedar trees, and carpenters and masons. And they built David a house. So David knew that the Lord had established him as king over Israel, and that He had exalted His kingdom for the sake of His people Israel.
Or …
It would seem more than likely that the Temple is intended, seeing that the vast majority (viz. hundreds) of references to a specific “house” in the Old Testament are to the Temple … That the intended reference is to the dedication of the Temple is also supported by early Jewish tradition, according to which this psalm was recited in the Temple on the eight days of Hanukkah, which feast commemorates the (re)dedication of the Temple. David’s wording in vs. 6-7 also suggest a time when he was well established in the “security” of his Jerusalem palace … This psalm would have been written by David, on the basis of God’s assurance in 2 Samuel 7:13, in anticipation of Solomon’s building and dedication of the Temple. The theme of chastisement is quite apropos in this regard, since David was denied the privilege of building the Temple in chastisement for his bloodthirstiness (1 Chronicles 28:3), and in the same breath that God declares that Solomon will build the Temple He emphasizes chastisement as a primary expression of His paternal solicitude (2 Samuel 7:14). — Wechsler, page 92.
__________