מדרש אויף תהילים 3:3

רַבִּים֮ אֹמְרִ֪ים לְנַ֫פְשִׁ֥י אֵ֤ין יְֽשׁוּעָ֓תָה לּ֬וֹ בֵֽאלֹהִ֬ים סֶֽלָה׃

פֿיל זאָגן אױף מײַן זעל:ניטאָ פֿאַר אים קײן הילף בײַ גאָט. סֶלָה.

Pesikta DeRav Kahana

"When you take a census (Ex. 30:12)."*The Torah reading for Shabbat Shekalim, the first of the Arba Parshiot recited during the maftir on the four Shabbats preceding Passover. As will be explicated midrashically, ki tisa ("when you take") is susceptible to various other meanings.
"Many say of my soul, 'There is no salvation for him through God, Selah.'" (Ps. 3:3). Rabbi Shimon and the Rabbanim: Rabbi Shmuel bar Ami interpreted the verse [as referring] to Doeg and Achitophel.*Doeg the Edomite served under King Saul and carried out the executions of priests who had helped David during his flight from Saul (see 1 Sam. 22:18-19). Achitophel was a counselor to King David who betrayed the king by leading Absalom's rebellion against David, before committing suicide (see 2 Sam. 17:21-23)."Many say of my soul" -- that is Doeg and Achitophel. And why would they be called "many" (rabim)? For they were masters (rabim) of the Torah. "They say of my soul": They said to David, "A person who steals a sheep, kills the shepherd (see 2 Sam. 12:4), and cuts down Israel with a sword, can there be salvation for him? 'There is no salvation for him through God, Selah.'" David said, "But You, Hashem" (Ps. 3:4): You agreed with them, and You wrote in Your Torah, stating, "The adulterer and the adulteress will surely be put to death" (Lev. 20:10). "...Are a shield about me" (Ps. 3:4): For You have shielded me through the merit of my forefathers. "...My glory" (ibid.): For You returned me to the kingship. "...Who holds my head up high" (ibid.): For I was obligated to You and You have granted me a "suspended head" (i.e., suspended my sentence) through the agency of Nathan the Prophet, who said to me, "Even Hashem will pass over your sin; you shall not die" (2 Sam. 12:13).
And the Rabbanim interpret the verse [as referring] to the nations of the world. And why are they called "many"? As it is written, " "Woe to the multitude of many (rabim) peoples" (Is. 17:12). "They say to my soul": They say to Israel, "A nation that heard from the mouth of its God on Mount Sinai, "There shall not be unto you any other Gods before Me" (Ex. 20:2), yet at the end of forty days, [Israel] said to the [Golden] Calf, 'These are your gods, O Israel!' (Ex. 32:4) -- can there be salvation for it? 'There is no salvation for him through God, Selah.'" Israel said, "But You, Hashem, agreed with them, and You and wrote in Your Torah, saying, 'He who sacrifices to [other] gods shall be utterly destroyed' (Ex. 22:19).'" "...A shield about me": For You have shielded us through the merit of our forefathers. "...My glory": For you have caused Your Shekhinah to dwell in our midst, as it is written, "And make for Me a sanctuary, and I will dwell in their midst" (Ex. 25:8). "...Who holds my head up high": For we were obligated to You and You have granted us a suspended head (rosh) through the agency of Moses, and You said, "When you take a census (ki tisa et rosh; or midrashically, 'When you take away [the guilt from] the head') of the Children of Israel" (Ex. 30:12).
פֿרעגט אַ רבֿBookmarkShareCopy

Midrash Tanchuma

Similarly, when the representative of the community held the Kiddush or Havdalah cup in his hand he would say: “Have you agreed, what is your decision?”5A expression meaning: “Have you agreed to allow me to recite this prayer?” See Jastrow. And the congregation would respond: “To life”; that is to say, May this cup be for the living. R. Levi discussed the words Tabernacle of testimony. It is written elsewhere: For the mouth of them that speak lies shall be stopped (Ps. 63:12), that is to say, the mouths of the peoples of the world, who say to Israel that the Shekhinah will never return to Israel, should be stopped, as it is said: Many there are that say of My soul: “There is no salvation for him in God.” Selah (Ps. 3:3). Before they built the golden calf, the Holy One, blessed be He, dwelt among them, but when He became angry at them they would say: “He will never return to them.” What did He do? He said: Let them make Me a Sanctuary that I may dwell among them (Exod. 25:8). Then all the inhabitants of the world will know that I have pardoned Israel. Therefore it is written; The Tabernacle of the testimony. It hath already been6Indicating that what was to follow had already been written. (Eccles. 1:10).
פֿרעגט אַ רבֿBookmarkShareCopy

Midrash Tanchuma Buber

[(Exod. 30:12): WHEN YOU TAKE <A CENSUS>.] This text is related to Ps. 3:3 [2]): MANY SAY TO MY SOUL….. This refers to David, when that deed (of II Sam. 11) took place at his hand.11Tanh., Exod. 9:4; PRK 2:1; PR 10:10; M. Pss. 3:5/6. They said: What person is there who has carried off the ewe lamb, killed the shepherd, and made Israel fall by the sword?12The ewe lamb was Bathsheba, and the shepherd was Uriah the Hittite. Is there salvation for him? (Ibid., cont.:) THERE IS NO SALVATION FOR HIM THROUGH HIS GOD. David said (in vs. 3 [2]): AND YOU, O LORD, have concurred with them and have written in the Torah (at Lev. 20:10): THE ADULTERER AND THE ADULTERESS SHALL SURELY BE PUT TO DEATH. Still (according to Ps. 3:4 [3]) <YOU, O LORD, ARE> A SHIELD ABOUT ME. You <are the one> who shielded me through the merit of my ancestors, <the one> who restored me to the kingship, AND (ibid. cont.:) THE ONE WHO RAISES UP MY HEAD. Instead of that which I owed you, < namely > the lifting off of the head, you gave me an uplifted head at the hands of the prophet Nathan, [who said to me] (in II Sam. 12:13): THE LORD HAS ALSO REMITTED YOUR SIN; YOU SHALL NOT DIE.
פֿרעגט אַ רבֿBookmarkShareCopy