Historical commentary by Matthew Henry. The wording and interpretations below belong to the original source.
The Magistrate's Resolution.
In these verses,
I. The psalmist gives to God the praise of his advancement to honour and power, and the other great things he had done for him and for his people Israel ( v. 1 ): Unto thee, O God! do we give thanks for all the favours thou hast bestowed upon us; and again, unto thee do we give thanks; for our thanksgivings must be often repeated. Did not we often pray for mercy when we were in pursuit of it; and shall we think it will suffice once or twice to give thanks when we have obtained it? Not only I do give thanks, but we do, and I and all my friends. If we share with others in their mercies, we must join with them in their praises. " Unto thee, O God! the author of our mercies (and we will not give that glory to the instruments which is due to thee only), we give thanks; for that thy name is near (that the complete accomplishment of thy promise made to David is not far off) thy wondrous works, which thou hast already done for him, declare. " Note, 1. There are many works which God does for his people that may truly be called wondrous works, out of the common course of providence and quite beyond our expectation. 2. These wondrous works declare the nearness of his name; they show that he himself is at hand, nigh to us in what we call upon him for, and that he is about to do some great things for his people, in pursuance of his purpose and promise. 3. When God's wondrous works declare the nearness of his name it is our duty to give him thanks, again and again to give him thanks.
II. He lays himself under an obligation to use his power well, pursuant to the great trust reposed in him ( v. 2 ): When I shall receive the congregation I will judge uprightly. Here he takes it for granted that God would, in due time, perfect that which concerned him, that though the congregation was very slow in gathering to him, and great opposition was made to it, yet, at length, he should receive it; for what God has spoken in his holiness he will perform by his wisdom and power. Being thus in expectation of the mercy, he promises to make conscience of his duty: "When I am a judge I will judge, and judge uprightly; not as those that went before me, who either neglected judgment or, which was worse, perverted it, either did no good with their power or did hurt." Note, 1. Those that are advanced to posts of honour must remember they are posts of service, and must set themselves with diligence and application of mind to do the work to which they are called. He does not say, " When I shall receive the congregation I will take my ease, and take state upon me, and leave the public business to others;" but, "I will mind it myself." 2. Public trusts are to be managed with great integrity; those that judge must judge uprightly, according to the rules of justice, without respect of persons.