Bible Commentaries
Psalms 51

Pett's Commentary on the BiblePett's Commentary

Introduction

Heading.

‘For the Chief Musician. A Psalm of David; when Nathan the prophet came to him, after he had gone in to Bath-sheba.’

Following the nine Psalms of the sons of Korah and a Psalm of Asaph we now have a further series of Psalms of David. The headings indicate that a number of these, at least, were written by David personally (in some cases ‘to/for David’ could signify the Davidic house). It is dedicated to the Choirmaster, or chief musician. What this actually signified we do not know. Possibly the choirmaster originally had his own collection of psalms and hymns.

This first Psalm, one of the most famous of the Psalms, was written by David in repentance over his sin with Bathsheba, when he stole Uriah’s wife from him and then arranged for Uriah’s death (2 Samuel 11:0). It was one of the blackest moments in his career, and resulted in great grief for him later on when his sons in one way or another followed his example.

Nevertheless David’s genuine repentance is clear from the words of the Psalm. But his experience is a reminder that sin always has its consequences for others, even when we have been forgiven.

Verses 1-2

An Appeal For Forgiveness And Cleansing (Psalms 51:1-2 ).

The Psalm commences with an appeal to God for forgiveness and cleansing. In these verses David throws himself on the mercy of God, in recognition that only in God’s supreme compassion is there any hope for him. He knew that he had committed the sins of adultery and murder, which in earlier times would have resulted in his execution. He knew that for these sins there was no pardon. And yet such is his intense faith that he is convinced that God will pardon him, not because he deserves it, not because of who he is, not through the cultic ritual, but because of God’s great compassion and mercy.

Psalms 51:1-2

‘Show your grace towards me , O God,

According to your covenant love,

According to the abundance of your tender compassions,

Blot out my transgressions (rebellions),

Launder me thoroughly from my iniquity,

And cleanse me from my sin.

‘Show your grace towards me.’ Often translated as ‘have mercy on me’ the Hebrew is better translated as ‘show your grace, your unmerited love and favour, towards me’. The emphasis is not on his own need for forgiveness, but on the greatness of God’s undeserved love and favour. He knows that without that he is undone, for he is a defector. He has rebelled against God and thwarted His Law.

He is aware that nothing can excuse what he has done. No sacrifice can atone for it, no way of atonement is provided. He had sinned ‘with a high hand’. His only hope lay in what God is as the One Who is ‘a God full of compassion and gracious, slow to anger and plenteous in mercy and truth, Who keeps mercy for thousands, forgiving iniquity and transgression and sin’ (Exodus 34:6-7).

As one who is within the covenant he points to God’s chesed, His love revealed in the covenant, a sovereign love to those wholly undeserving. He points to the huge number of His tender compassions. And on the basis of this he calls for God to blot out every trace of his acts of rebellion, to thoroughly wash him from his depraved and filthy conduct, and to cleanse him from having turned in the wrong way and missed the mark. He is totally honest. He realises that it is his only hope. Nothing can ameliorate what he has done. He knows that there are no excuses. No sacrifice can avail. He deserves immediate execution. It is total and heartfelt repentance. He is throwing himself utterly on God’s mercy.

‘Blot out my acts of rebellion.’ He wants his record made clean, so that nothing stands against his name that can be brought against him in the future. He knows that strictly speaking adultery and murder are not forgivable sins. His only hope is for the record of them to be totally removed (compare Psalms 51:9).

‘Launder me thoroughly from my depraved and filthy conduct’. This is not a reference to cultic washings. The word is never used of the washing of the person in the cult, but of the washing of the person’s clothes, and it never availed for the cleansing of sin. Such washings were regularly followed by the words ‘and shall not be clean until the evening’. The washing was preparatory, removing earthly stains from the clothes so that it was possible to wait on a pure God. But it was the time spent waiting on God that cleansed. It has more to do with Jeremiah 2:22; Jeremiah 4:14 where the principle of laundering is applied to the person. In Jeremiah 2:22 it would not avail, but in Jeremiah 4:14 it was seemingly to be effective, and was by their evil thoughts being removed from them. David is thus using a metaphor concerning his need to be laundered clean, taken from daily life and not from the cult.

‘Cleanse me from my sin.’ This verb is more closely connected with cult cleansing, especially with regard to the cleansing of leprosy, but the water there did not physically cleanse the leprosy, it was for cultic ‘cleansing’ once the leprosy was healed or seen as harmless. David, however, would know that for his sins the cult was ineffective. So here, where David was not wanting cultic cleansing (which was not possible for murder and adultery) but full, deep inner cleansing of his life, we are probably to see it as parallel in idea to the previous reference to the laundering of his life. The cult is far from his mind. He wants removal of his filthiness of heart. He has more in mind the royal bath house.

Verses 3-6

David Freely And Openly Admits His Total Sinfulness And Guilt (Psalms 51:3-6 ).

David tells God that he now knows the truth about himself. He no longer dismisses what he has done as unimportant because he is a king and chief judge, and therefore, as the one finally responsible for the law, above the law. For God has brought home to him the depths to which he has fallen. He now recognises his responsibility towards a greater King and Judge. As he said to Nathan when his sin was made clear to him, ‘I have sinned against YHWH’ (2 Samuel 12:13).

Psalms 51:3-4

For as for me I know my transgressions,

And my sin is ever before me.

Against you, you only, have I sinned,

And done what is evil in your sight,

That you may be justified when you speak,

And be clear when you judge.

In the Hebrew the ‘I’ is emphasised, which we have indicated by the words ‘as for me’. He is emphasising his inner awareness of his own guiltiness. ‘I know’, that is, I have recognised the situation for what it is and am fully aware of what I have done. I recognise that I have no excuse. ‘My rebellions.’ He has not just done wrong, he has been in rebellion against God, something revealed by his two acts of open rebellion. ‘My sin is ever before me.’ All who have ever come under deep conviction of sin will know what he means. Whatever he tries to do he cannot get away from the heavy weight of guilt that lies upon him. It continually forces itself on his attention. Only God can remove it.

‘Against you, you only have I sinned.’ He had, of course, sinned against Uriah, and he had sinned against the nation by bringing it under the wrath of God. But Uriah was dead and could not hold him accountable. And the nation had no jurisdiction over him. Who else could bring the king into account? There was only One other and that was God. He was responsible only to God. Indeed, it was the shame that he had brought on God’s Name that wholly possessed his thoughts. He was a man who truly loved God, and the thought of how he had disgraced his God tore deep into his heart. It blotted out any other thought.

‘And done what is evil in your sight.’ No one had seen his adultery, he had made sure of that. The murder had been cleverly concealed. Only Joab knew of his desire to have Uriah killed. All his attention had been on ensuring that no one else knew. And he had been quite satisfied in his heart that he was in the clear. But now Nathan had brought home to him the fact that God had been watching all the time. God had seen everything that he had done, and was appalled by it. He had not only done evil, but he had done it openly before God. His greatest sin was his treating of God as though He would not know and flouting His severest Laws before His eyes. The words echo the words of Nathan in 2 Samuel 12:9, ‘why have you despised the word of YHWH, to do what is evil in His sight?’.

‘In order that you may be justified when you speak, and be clear when you judge.’ Thus he admitted that God was totally justified in pronouncing judgment against Him, He was after all an eyewitness, and was thus totally in the clear in judging him. No charge could be brought against God of unfairness. He had seen what had been done.

David does not, of course mean that his sin was committed in order that God might be justified, as though the revelation of God’s justice rested upon his having sinned, thus suggesting that his sin has achieved a good purpose. The reference back is rather to his having done it in His sight. It was because he had done it in His sight that God was justified in passing sentence. He had not, of course intended to do it in God’s sight. But all that we do is in His sight. This is why none of us can avoid our sins, or God’s judgment on them. It is because He is an eyewitness to them. And God has determined that all that we do should be done in His sight in order that He might be justified in calling it into account.

Psalms 51:5-6

Behold, I was brought forth in iniquity,

And in sin did my mother conceive me.

Behold, you desire truth in the inward parts,

And in the hidden part you will make me to know wisdom.

In his deep awareness of his sinfulness David now looks back to how it is he can be so depraved. It is because he was the product of sinful parents. It is because man is inherently sinful so that every child born is sinful. He is not excusing his sin, but recognising his true state, and the true state of every man. There was only One Who was brought forth sinless. And He was not the product of a human father, nor of a human egg. He was miraculously conceived by the Holy Spirit’s working (Matthew 1:20; Luke 1:35). Thus all men, including the smallest child, is sinful before God, although not guilty until a sin is first committed. However, that act of sin is not long in coming. ‘The unrighteous are estranged from the womb, they go astray as soon as they are born speaking lies’ (Psalms 58:3). Lying and deceit is inherent in human nature.

‘Behold, you desire truth in the inward parts, and in the hidden part you will make me to know wisdom.’ God, on the other hand, demands truth. He is the very opposite of man. And what He requires of those who love Him, is not an outward response of truth only, but truth in the inward parts. Total honesty within. This requires the mighty working of God within, spoken of in the Old Testament as being ‘circumcised in heart’ (Deuteronomy 30:6; compare Deuteronomy 10:16; Jeremiah 4:4; Exodus 6:30) and ‘having the law written in the heart’ (Jeremiah 31:33), and in the New Testament as being ‘born from above’ (John 3:3) and ‘newly created’ (2 Corinthians 5:17; Ephesians 2:10). For such an experience only comes about when God makes us to know wisdom in our inner lives. David was thus aware that such an experience could only come about by the divine activity of God.

Verses 7-9

His Prayer For Forgiveness And For The Removal Of His Sins (Psalms 51:7-9 ).

David now turns to the question of how his sins can be removed from him. He recognises that outward ritual would be irrelevant (‘you do not desire sacrifice, or else I would give it’ - Psalms 51:16). There was no prescription for murder and adultery within the cult. That only knew of execution as the way of dealing with them. What David required was the activity of God Himself in removing his sin.

Psalms 51:7-9

‘Purify me with hyssop, and I will be clean,

Launder me, and I will be whiter than snow.

Make me to hear joy and gladness,

That the bones which you have broken may rejoice.

Hide your face from my sins,

And blot out all my iniquities.

‘Purify me with hyssop, and I shall be clean.’ David uses the language of the cult when he refers to being ‘purified with hyssop’. Hyssop was a common plant that grew on walls and was used as a means of sprinkling water and blood in the cult (see Exodus 12:22; Leviticus 14:4 ff.; Numbers 19:6 ff., Numbers 19:18 ff.). David, in effect, is calling on God to do the same for him. Let Him, as it were, acting as his priest, purify him through the blood of sprinkling (compare 1 Peter 1:2). In mind may have been the water of purification, water containing sacrificial ashes (Numbers 19:18). But David is probably rising above the cult to the activity of God Himself (compare Psalms 51:16). He knew that there was no cosy way out for what he had done. He had sinned ‘with a high hand’. All depended on God to act. His sins were such that only the direct action of God could deal with them. It was an unconscious prophecy that one day God would provide a means of cleansing separate from the cult.

‘Launder me, and I shall be whiter than snow.’ That this goes far beyond the cult comes out in the description. He wants God to act directly in laundering him. He wants his heart laundering. And he wants to be ‘whiter than snow’. A similar picture is used in Isaiah 1:16-18, ‘bathe yourselves, make yourselves clean, put away the evil of your doings from before My eyes, cease to do evil, learn to do well -- though your sins be as scarlet they will be as white as snow.’ The difference lies in the fact that in Isaiah it was people who had to do it by changing the course of their lives, whilst here David recognises that for him only God can do it. But even in Isaiah there is no reference to the cult, for he has previously dismissed the cult as achieving nothing (Isaiah 1:11-15), and in doing so he has ignored cult washing of clothes and cleansing altogether. Thus they do not appear to have been in Isaiah’s mind. The same is probably true of David here. He is thinking of the launderer as providing his metaphor, not the cult. But he certainly wants the evil of his doings to be put away from before God’s eyes (Psalms 51:4 b, Psalms 51:9), which he recognises can only be achieved by God’s activity.

‘Make me to hear joy and gladness, that the bones which you have broken may rejoice.’ Having been faced up to his sins David became aware that something of the joy and gladness that he had once known had been lost. Outwardly his religious life continued the same, but he was aware that for some time the inward joy and gladness had been missing (it could hardly have been otherwise). And that had been accentuated once he was faced up with his guilt. So now, in his hope of forgiveness and cleansing, and of the renewing of his spiritual life (Psalms 51:10), he prays that his former joy in God might be restored (compare Psalms 51:12). He wants to hear his inner self rejoicing in God. The breaking of the bones is not literal. The bones were seen as representing the man within. And that man within had been broken. It had been crushed and had lost the joy of God’s presence. He wanted to be restored to God’s favour. Paradoxically, as he will point out later, the remedy for his broken bones is a broken heart (Psalms 51:17).

‘Hide your face from my sins, and blot out all my iniquities.’ He asks God to hide away His face from his sins, in other words not to look on them, to treat them as something that does not come before His gaze. We can compare the words of Hezekiah, ‘you have cast all my sins behind your back’ (Isaiah 38:17). Indeed, he wants them ‘blotted out’ (compare Psalms 51:1; Isaiah 43:25; Isaiah 44:22), in the same way as He had blotted out Amalek from men’s memory (Exodus 17:14; Deuteronomy 25:19), had blotted man out at the Flood (Genesis 6:7; Genesis 7:4; Genesis 7:23), and would blot out sinners from His book (Exodus 32:33; Deuteronomy 9:14; Deuteronomy 29:20), from the book of the living (Psalms 69:28). He wanted his sins to be no more.

Verses 10-13

A Prayer For Transformation (Psalms 51:10-13 ).

Genuine repentance seeks not only forgiveness, but transformation of life. It is no good asking for forgiveness if we intend to do it again. So David wanted not only to be forgiven but also to be restored into the way of obedience in which he had once walked, for then only could his fellowship with God be restored. And he knew that this required the powerful activity of God within him.

Psalms 51:10-13

Create in me a clean heart, O God,

And make new a steadfast spirit within me.

Cast me not away from your presence,

And take not your holy Spirit from me.

Restore to me the joy of your salvation,

And uphold me with a willing spirit.

I will teach transgressors your ways,

And sinners will be converted to you.

‘Create in me a clean heart, O God, and make new a steadfast spirit within me.’ The word used for ‘create’ is the one which is regularly used of God’s creative power. It indicates the bringing about of something new. It suggests that he sees his sins as having been so heinous that he needs a new creation to take place within him. His ‘heart’, his mind, will and emotions, needs to be reconstituted because the old has been damaged beyond repair. And only God can do it. This is confirmed by the second verb which means to ‘make new’. He feels that he has failed God so utterly that there has to be a wholly new beginning. A ‘clean’ heart is a heart free from all taint of sin, including being free from adultery (Numbers 5:28). It is a heart which knows and obeys God (Jeremiah 24:7; Jeremiah 32:29; Ezekiel 11:19; Ezekiel 36:26). A steadfast spirit is one that will keep free from succumbing to temptation.

The Law spoke of two kinds of sins. ‘Sins done in ignorance, that is, unwittingly’, for which forgiveness and atonement could be obtained through the offering of sacrifices, and ‘sins with a high hand’ for which the penalty was death. They were acts of open and deliberate defiance of God. Adultery and murder were seen as ‘sins with a high hand’. There was no atonement for them. For those only God acting directly could remit the ultimate penalty.

So David is calling on God to perform the ultimate miracle, the total transformation of his inner life. His awareness of his guilt is so great that he is convinced that nothing less will do. He knows that in God’s eyes his old self is under sentence of death. He is therefore pleading for a new self.

What is described here is precisely what happens when a person commits himself to Jesus Christ for salvation. He becomes a new creation. Old things pass away and all becomes new (2 Corinthians 5:17; Ephesians 2:10; Ephesians 4:24). He receives a ‘clean’ heart and a ‘steadfast spirit’. It is only the pure in heart who can ‘see God’ (Matthew 5:8). Thus from then on he has to put to death the old man, and respond to the new (Romans 6:2-11; Ephesians 4:22-24). In a sense therefore this prayer cannot be prayed by a Christian, who when he becomes aware of sin knows that his new life is still intact. He prays for renewal rather than making new. But the principle is the same. He still needs God’s powerful work within in order to be renewed.

‘Cast me not away from your presence, and take not your holy Spirit from me.’ This is speaking of a special enduement of the Spirit for God’s work, not simply of the presence of the Holy Spirit in a believer. David was very conscious of the fact that he enjoyed a unique privilege. God had taken way His Spirit from Saul and had rejected Saul (1 Samuel 16:14; compare 1 Samuel 15:11; 1Sa 15:23 ; 1 Samuel 15:35; 1 Samuel 16:1) and had put His Spirit on David (1 Samuel 16:13). Now he was very fearful lest God would do the same to him as he had done to Saul. To be cast from the king’s presence was an indication of rejection, and an indication that the person was no longer suitable to serve the king. In the same way David had visions of this happening to him before God. He is not talking of ‘loss of salvation’ but of loss of acceptability and usefulness. He does not say, ‘restore to me your salvation’, but ‘restore to me the joy of your salvation’.

Restore to me the joy of your salvation, and uphold me with a willing spirit.’ Earlier (in Psalms 51:8) he had prayed for joy and gladness to be restored to his inner man. Now he repeats his request. He had missed the joy of the Lord for so long that he had not realised it. But now it has come home to him with full force, and he prays for it to be restored. The joy was joy in God’s ‘salvation’, the status of being a forgiven sinner. ‘Blessed is he whose transgression is forgiven, whose sin is covered -- in whose spirit there is no guile’ (Psalms 32:1-2). Note the connection of forgiveness of sins with a right spirit within. Here also he connects the two as he prays for a willing spirit, a ‘made new’ spirit (Psalms 51:10). This willing spirit parallels his anticipated joy in salvation. Alternately he was praying that God would have a willing spirit towards him. He had sinned deeply with a high hand. In that case he was recognising that the choice lay wholly with God as to whether He forgave him or not, so it was then a question as to whether God was so willing. He was praying that He would be, a prayer shown as answered in 2 Samuel 12:13. But the parallel suggests that the willing spirit was to be David’s (all the other parallels are repeating two parallel ideas).

‘I will teach transgressors (rebels) your ways, and sinners (offenders) will be converted to you.’ These words connect closely with the previous ones. It is only if he is still acceptable in God’s presence and still His anointed one, that he will be in a position to use his position and authority to teach others the right way, and to face men up with their rebelliousness and their offences. His own need of restoration has brought home to him the precarious situation of others before God. But he can only help them if he himself has been restored. It is those who are most conscious of what God has done for them, who seek humbly to help others. He is not bargaining with God. He is asserting his intention once he himself has been restored.

Verses 14-17

Recognising That His Only Hope Lies In Total And Contrite Submission David Makes A Final Plea That God Will Deliver Him From Blood-guiltiness (Psalms 51:14-17 ).

Blood-guiltiness is an idea prominent in the Old Testament. When a person slew another person they were seen as blood-guilty and their lives were seen as forfeit to the ‘avengers of blood’, relatives of the deceased person who sought to take the slayer’s life in return. Indeed, it was seen as incumbent on them to do so. If they slew him no court would find them guilty. It was the only way in which justice could be maintained (there was no police force). That was why ‘cities of refuge’ were provided to which men could flee if they had killed someone accidentally. Once in such a city they were safe. But they could only remain there if they could satisfy the elders of the city that the killing had not been intentional. On the other hand, if the avengers of blood were willing to come to some arrangement (such as compensation) with the killer, then he would go free. Much would depend on the circumstances.

Of course, no one was going to try to kill David. He was too powerful. So in cases like this the idea was that God would take their lives. They were forfeit to Him, which is why Nathan had to assure David, ‘You will not die’ (2 Samuel 12:13). Thus David, recognising this, is pleading for clemency. He is asking that God will withhold his sentence of death. We are all under sentence of death because of sin (Romans 6:23). We also therefore constantly require God’s clemency.

Psalms 51:14-15

‘Deliver me from bloodguiltiness, O God, you God of my salvation,

And my tongue will sing aloud of your righteousness.

O Sovereign Lord, you will open my lips,

And my mouth will show forth your praise.

He cries to God to deliver him ‘from blood’. The blood of his victim Uriah cries out to God for vengeance, as did the blood of Abel (Genesis 4:10), and he hopes that like Cain he might, as a consequence of God’s compassion and mercy, be saved from the final punishment that his crime deserved, just as God has delivered him in the past. For he was fully aware of how much he owed to God for past deliverances. God was the God of his salvation. He was only there because God had watched over him so constantly. And he hoped that He would deliver him again. Strictly he could claim before men that he had not killed Uriah. Uriah had died in battle. But he knew that that plea would not work before God. It was he who in a cowardly way had pronounced sentence of death on Uriah (2 Samuel 11:15) for no good reason other than to hide his own sinfulness. We can hardly conceive of those words to Joab as being words of David, if they had not been spelled out in black and white. They are an indication of what even the finest Christian man is capable of when trying to hide something of which he is ashamed.

Alternately ‘from blood’ may signify ‘from his own blood being spilled’ (compare Ezekiel 18:10-13), and it may therefore be a plea to be delivered from his own blood being shed as a consequence of high handed sin. It would also then include his adultery. But in either case he is acknowledging that in God’s eyes he is under sentence of death, and that his only hope lies in the granting of a pardon.

‘And my tongue will sing aloud of your righteousness.’ He promises that if he is pardoned he will use his gifts as a psalmist and musician to sing about and proclaim God’s righteousness. He will not take his pardon as indicating that God’s standards have been watered down. He will continually declare God’s righteousness and His righteous requirements, in the same way as he has been faced up with them himself. He will not lower God’s requirements by even the smallest amount. But the paralleling of salvation with righteousness would be a theme of Isaiah, where righteousness paralleled with salvation often signifies righteous deliverance. Thus we could translate ‘righteousness’ as ‘righteous deliverance’. He would make clear how a righteous God could deliver in mercy.

‘O Sovereign Lord, you will open my lips, and my mouth will show forth your praise.’ The king whose power was a byword in his day now addresses God as his Sovereign Lord. He is dumb before Him because of his sins. He recognises that as a rebel he has no right to speak. (In those days a person would not speak in the presence of the king unless given the right to do so by the king. Compare Esther 5:1-2). Thus he tells God as his Sovereign Lord, that when, having pardoned him, He gives him permission to speak (opens his lips), his mouth will show forth His praise. He will humbly (Psalms 51:17) proclaim the goodness, righteousness and mercy of God.

Psalms 51:16-17

‘For you do not delight in sacrifice, else would I give it,

You have no pleasure in burnt-offering.

The sacrifices of God are a broken spirit,

A broken and contrite heart, O God, you will not despise.

He acknowledges that no offering that he offers, no sacrifice that he sacrifices, will be acceptable to God, because for the sins that he has committed no such sacrifice was provided. If offered in repentance sacrifices could atone for unwitting sins, but they could not atone for the sins of which he was guilty, ‘sins with a high hand’. He had blatantly committed capital crimes for which the only remedy was execution. If he brought sacrifices God would not delight in them (the sacrifice of the wicked is an abomination to YHWH - Proverbs 15:8). If he brought offerings God would have no pleasure in them. That his particular situation was in mind comes out in the words ‘or else I would give it’. Both before and after this time he would offer offerings and sacrifices aplenty, but at this stage he recognised that they would simply not be acceptable. He was restrained from offering them because he had put himself beyond their scope.

The only sacrifices that he could offer to God at this stage were the sacrifices of a broken spirit, and a broken and contrite heart. It was all that was open to him But these he was sure God would receive. He would not despise them (as He would offerings and sacrifices from the unrighteous). It was possibly these words that Isaiah had in mind in Isaiah 57:15.

‘A broken spirit, a broken and contrite heart.’ A broken spirit and heart are a spirit and heart whose resistance has been ‘broken’ by God’s rebuke and chastening (Proverbs 3:11-12), and which are thus contrite (repentant and grieved). These are what God seeks in all cases of sin. ‘Whom the Lord loves, he chastens, and scourges every son whom He receives. --- If you are without chastening, then you are illegitimate children and not sons’ (Hebrews 11:6; Hebrews 11:8).

Verses 18-19

A Prayer For The Prosperity of Jerusalem (Psalms 51:18 ).

The Psalm as it now stands ends with this prayer. It was possibly not a part of the original Psalm, (which was David’s written confession), but added when the Psalm became part of public worship. Although if David specifically wrote the Psalm with its use in public worship in mind, he could have included it at the beginning. It was a plea for God to protect Jerusalem, and prosper it, so that it would continue to offer up sacrifices and offerings, and sustain the worship of YHWH. The adding of it also made clear that Psalms 51:16 was not repudiating sacrifices and offerings.

Many see it as added after Jerusalem had been destroyed by the Babylonians, when the walls needed to be totally rebuilt. But against such a suggestion is the thought that we might then have expected the prayer to be for the restoration of the Temple. Building the walls of Jerusalem was not at the time the first priority. The offering of offerings and sacrifices required an altar and a Temple rather than a walled city (Ezra 3:0). But the prayer for God to ‘build the walls of Jerusalem’ could refer to any time after a siege in which parts of the walls had been severely damaged, of which there were a number known to us. Or it could indeed refer to attempts to repair and improve the fortifications after the taking over of the fortress city from the Jebusites (the word for ‘build’ means more than just ‘repair’). We know specifically that such improvements took place in the time of Solomon (1 Kings 3:1), and David, with that end in view, may well have established a liturgical prayer for that to prosper. That would then make Jerusalem safe from invaders and ensure continuation of the cult at the Tent set up by David to house the Ark. But it is impossible to be sure.

Psalms 51:18-19

Do good in your good pleasure to Zion,

Build you the walls of Jerusalem.

Then will you delight in the sacrifices of righteousness,

In burnt-offering and in whole burnt-offering,

Then will they offer bullocks on your altar.

The Psalm, along with other Psalms of David, was probably taken over for public worship in the time of David when David expanded pubic worship in the way that the Chronicler describes. It would then become a Psalm of penitence through which the people expressed their penitence to God for their sins. It could well have been at this stage that this verse was added in order to make the Psalm more expressive of the prayers of the people, or it may be that David was writing the Psalm with public worship in mind from the beginning.

The call is for God to ‘do good’ to Jerusalem and ‘build’ its walls, so that it would prosper and be kept safe from its enemies. It could refer to any period from David onwards. And the aim was the safe and permanent establishment of the cult of YHWH within its walls. As a consequence of that security God would be able to delight in the sacrifices of righteousness, in burnt offering and whole burnt offering, with bullocks being offered on YHWH’s altar, i.e. the one set up in Jerusalem.

‘The sacrifices of righteousness’ may well have been called that in contrast with the sacrifices that had previously been offered up by the Jebusite priesthood. They were seen as false sacrifices. This would then point to it having been written in the time of David. Or it may refer to the restoring of the untainted cult after the Exile, the ‘sacrifices of righteousness’, offered in purity of worship, being distinguished from the tainted sacrifices offered before the Exile. The ‘burnt offering’ (the ‘going up offering’) had in mind the time when the sacrifice was being offered up as offerings which ‘go up’. The ‘whole burnt offering’ (the ‘completed’ or ‘wholly consumed’ offering) then indicated the time when the burnt offering was wholly consumed. The one would result in the other. Burnt offerings were offered daily in the Tabernacle and the Temple, and the process would be continual. As one burnt offering was finally consumed, another would replace it. Worship was continual. Or there may have been a technical difference between ‘burnt offerings’ and ‘whole burnt offerings’ (both are technical terms for ‘whole offerings’ in the Hebrew but the latter is only used in respect of offerings on behalf of priests - Leviticus 6:22-23).

Bibliographical Information
Pett, Peter. "Commentary on Psalms 51". "Pett's Commentary on the Bible ". https://studylight.org/commentaries/eng/pet/psalms-51.html. 2013.