I've always understood that the war with Amalek is an ongoing concern (and that the mitzvah to blot out Amalek's memory is ongoing), but I saw some puzzling Rashi today that seems to contradict that. This probably means I'm misunderstanding Rashi, so I'm looking for help.
Tehillim 9 says in part:
4 When my enemies draw backward, they stumble and are destroyed from before You.
5 For You have performed my judgment and my cause; You sat on the throne, O Judge of righteousness.
6 You rebuked nations, You destroyed a wicked man; You erased their name forever and ever.
7 The enemy has been destroyed; swords exist forever, and You have uprooted the cities-their remembrance is lost.
8 But the Lord shall sit forever; He has established His throne for judgment.
Rashi says, on 6:
You rebuked nations: [This alludes to Amalek, described in Num. 24:20 as] “Amalek is the first of the nations.”
You destroyed a wicked man: Esau.
You erased their name: “For I will surely erase the remembrance of Amalek” (Exod. 17:14).
So it sounds like Rashi is saying that God "erased" Amalek at this time (after rebuking them), which is not what I would have thought. (All these verbs are in the past tense.) To further reinforce this, consider Sh'mot 17:16:
16 And he said, For there is a hand on the throne of the Eternal, [that there shall be] a war for the Lord against Amalek from generation to generation.
Rashi says nothing at all here about the war "from generation to generation", which to my perhaps-naive eye sounds an awful lot like "forever". But he does comment there, tying this throne image to the destruction of Amalek in Tehillim 9:
For there is a hand on the throne of the Eternal: Heb. כִּי-יָד עַל כֵּס יָ-הּ. The hand of the Holy One, blessed be He, was raised to swear by His throne, to have a war and [bear] hatred against Amalek for eternity. Now what is the meaning of כֵּס [as opposed to כִּסֵא and also [why is] the Divine Name divided in half? [I.e., why is the Name יָ-הּ used instead of י-ה-ו-ה ?] [The answer is that] the Holy One, blessed be He, swore that His Name will not be complete and His throne will not be complete until the name of Amalek is completely obliterated. And when his name is obliterated, the Divine Name will be complete, and the throne will be complete, as it is said: “The enemy has been destroyed; swords exist forever (לָנֶצַח)” (Ps. 9:7); this [who they are referring to] is Amalek, about whom it is written: “and kept their fury forever (נֶצַח)” (Amos 1:11). "And You have uprooted the cities-their remembrance is lost" (Ps. 9:7) [i.e., Amalek’s obliteration]. What does it say afterwards? “And the Lord (וַיהוה) shall sit forever” (Ps. 9:8); thus [after Amalek is obliterated] the Name is complete. "He has established His throne (כִּסְאוֹ) for judgment" (Ps. 9:8). Thus the throne is complete [i.e., thus the throne, here spelled with an “aleph,” is now complete]. — [from Midrash Tanchuma, end of Ki Theitzei]
So my question is: what's Rashi really saying here? Is he really saying that God obliterated Amalek at the time of the psalm? If so, how does he reconcile that with (a) the mitzvah for us to wipe out Amalek's memory and (b) the common understanding that Haman, centuries later, was an Amalekite (to say nothing of others for whom similar claims have been made throughout the centuries)?