Another matter, “When [the Lord your God] will expand [your border]” – that is what the verse said: “I rejoice and am happy in Your kindness, for You have seen my affliction. You have known my soul’s distress, and You did not deliver me into the hand of the enemy; You set my feet in open space” (Psalms 31:8–9). The Rabbis say: This verse is speaking of Joseph. Joseph said: ‘Master of the universe, “I rejoice and am happy in Your kindness” that You performed with me.
Had You exacted revenge on my behalf from Potifera’s wife, and had not given me the kingship, I would have rejoiced and been happy. Now that I have the kingship, “I rejoice and am happy in Your kindness….”’ “For You have seen my affliction” – this is Joseph, in whose regard it is written: “[He had sent a man before them, Joseph, who had been sold as a slave.] They tortured his legs with chains; his body was placed in irons” (Psalms 105:17–18).
“You did not deliver me into the hand of the enemy” – this is Potifera. “You set my feet in open space” –You made me ruler over the entire land of Egypt. From where is this derived? As it is stated: “Joseph was the ruler over the land; he was the provider of grain to all the people of the land.
Joseph's brothers came, and prostrated themselves to him, faces to the ground. Joseph saw his brothers, and he recognized them, but he acted as a stranger to them, and spoke harshly to them; he said to them: From where did you come? They said: From the land of Canaan, to acquire food” (Genesis 42:6–7). Another matter, [the verse] “I rejoice and am happy in Your kindness” is speaking of Israel.
Israel said: ‘Master of the universe, “I rejoice and am happy in Your kindness” that You performed with us. Had You exacted revenge against the Egyptians and not given us their wealth, we would have rejoiced. We have joy and happiness because You gave us their wealth.’ “For You have seen my affliction” – this is Israel, in whose regard it is written: “The Egyptians mistreated us, and afflicted us, and imposed upon us hard labor.
We cried out to the Lord, God of our fathers, and the Lord heard our voice, and He saw our affliction…” (Deuteronomy 26:6–7). “You have known my soul’s distress” – this is Israel, in whose regard it is written: “They embittered their lives” (Exodus 1:14). “You did not deliver me into the hand of the enemy” – this is the wicked Pharaoh, as it is written: “The enemy said: I will pursue” (Exodus 15:9).
“You set my feet in open space” – as you expanded my border, as it is stated: “When [the Lord your God] will expand [your border].”