וּלְיוֹסֵ֤ף יֻלַּד֙ שְׁנֵ֣י בָנִ֔ים בְּטֶ֥רֶם תָּב֖וֹא שְׁנַ֣ת הָרָעָ֑ב אֲשֶׁ֤ר יָֽלְדָה־לּוֹ֙ אָֽסְנַ֔ת בַּת־פּ֥וֹטִי פֶ֖רַע כֹּהֵ֥ן אֽוֹן׃
און בײַ יוֹספֿן זײַנען געבאָרן געװאָרן, אײדער דאָס הונגעריאָר איז געקומען, צװײ זין, װאָס אָסנַת די טאָכטער פֿון פּוֹטי-פֿרַע דעם פּריסטער פֿון אוֹן האָט אים געבאָרן.
Midrash Aggadah
"And Potiphar, Pharaoh's chamberlain." Potiphar is Poti-phera (Genesis 41:50). Why is he called Potiphar? Because he fattenedthe calves for idolatry.
Aggadat Bereshit
[3] According to another opinion, Noah left the ark. David said, "He brought me out of the prison to give thanks to Your name, etc." (Psalms 142:8). When Noah was inside the ark, he prayed. As it is said, "For this let everyone who is godly pray to You" (Psalms 32:6). God said to him, "It is a decree of providence that you should complete twelve months, and if you do not complete them, you will not leave, as it is stated, 'Thus says the Lord: In an acceptable time I have answered you...To bind the captives and so on. Go forth, etc.'" (Isaiah 49:8-9). They were forbidden from marital relations, for when the world is in distress, a person must restrain himself from procreation. Thus Joseph also acted when he saw that the two famines were about to come. As it is said, "And to Joseph were born two sons before the year of famine came" (Genesis 41:50). Similarly, Noah, his sons, the animals, and the beasts did not need to procreate. As God said to him when he entered [the ark], "You and all your household enter the ark" (Genesis 7:1), and it is written, "Noah and his sons, his wife and his sons' wives with him" (Genesis 7:7), the males separate and the females separate. This can be compared to a king who went out to battle the barbarians and decreed that the baths should not be opened, and the mint should not be struck, until I return from battle. When he returned from the battle in peace, he decreed that the baths should be opened and the mint should be struck. All that I destroy, I build. Similarly, when the flood came, there was no need to procreate, as it is stated, "Go forth from the ark, etc." (Isaiah 49:9). Therefore, when the earth was dry, [God] said, "Go out of the ark." This is why it is said, "He brought me out of the prison" (Psalms 142:8). End of the section.
Midrash Tanchuma
To say to the prisoners go forth implies that they were enjoined from sexual intercourse. Why was that? When the world is overwhelmed by suffering and destruction, men are forbidden to (fulfill the command to) increase and multiply (Gen. 6:28) Surely, while the Holy One, blessed be He, is engaged in destroying the world, men should not strive to populate it. Joseph behaved accordingly. He indulged in intercourse with his wife only prior to the years of hardship, as it is said: And unto Joseph were born two sons (Gen. 41:50). When were they born? In the years preceding the famine.