In the Psalms, there are several places where David portrays himself as righteous and blameless. For example, Psalm 26:
1Vindicate me, O Lord,
for I have walked in my integrity,
and I have trusted in the Lord without wavering.
2Prove me, O Lord, and try me;
test my heart and my mind. (Psalm 26:1-2, ESV)
and Psalm 18:
20The Lord dealt with me according to my righteousness;
according to the cleanness of my hands he rewarded me.
21For I have kept the ways of the Lord,
and have not wickedly departed from my God.
22For all his rules were before me,
and his statutes I did not put away from me.
23I was blameless before him,
and I kept myself from my guilt.
24So the Lord has rewarded me according to my righteousness,
according to the cleanness of my hands in his sight. (Psalm 18:20-24, ESV)
In other places, David acknowledges that no one is righteous. For example, Psalm 53:
2God looks down from heaven
on the children of man
to see if there are any who understand,
who seek after God.
3They have all fallen away;
together they have become corrupt;
there is none who does good,
not even one. (Psalm 53:2-3, ESV)
and Psalm 143:
2Enter not into judgment with your servant,
for no one living is righteous before you. (Psalm 143:2, ESV)
How are these passages to be understood together? What is meant by "righteous" or "blameless," and what is David saying about himself and the human condition?