In the final verses of Psalm 26, David contrasts himself with 'sinners' and speaks of his own 'integrity' (as in earlier verses where he says: "I have walked in my integrity" and "I wash my hands in innocence").
9Do not sweep my soul away with sinners,
nor my life with bloodthirsty men,
10in whose hands are evil devices,
and whose right hands are full of bribes.
11But as for me, I shall walk in my integrity;
redeem me, and be gracious to me.
12My foot stands on level ground;
in the great assembly I will bless the LORD. Psalm 26:9-12 ESV
In my understanding of grace and sin, if David is not a 'sinner' then he has no need of grace - but David is clearly not using those words in quite the same way.
So how should we understand the words 'gracious' (and 'redeem'), and 'sinner' in this context?