What does Psalm 26:2 mean?
David invites the Lord to test his inner being: his heart and his mind. He has claimed to be a man of integrity and faith (Psalm 26:1), now he asks the Lord to search him and see that his claim is substantiated.In 1 Kings 9:4–5, when speaking to Solomon, the Lord affirmed David's integrity. He said: "And as for you [Solomon], if you will walk before me, as David your father walked, with integrity of heart and uprightness, doing according to all that I have commanded you, and keeping my statutes and my rules, then I will establish your royal throne over Israel forever."
It is good to invite the Lord to examine the heart and mind. Doing so preserves the believer's integrity. Psalm 139:23 records David's prayer: "Search me, O God, and know my heart! Try me and know my thoughts!"