ה֘וֹצִ֤יאָה מִמַּסְגֵּ֨ר ׀ נַפְשִׁי֮ לְהוֹד֪וֹת אֶת־שְׁ֫מֶ֥ךָ בִּ֭י יַכְתִּ֣רוּ צַדִּיקִ֑ים כִּ֖י תִגְמֹ֣ל עָלָֽי׃
Fais-moi sortir de ma geôle, pour que je puisse rendre hommage à ton nom. Les justes feront cercle autour de moi, si tu daignes me combler de tes bienfaits.
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
Go forth from the ark (Gen. 8:16). Scripture says elsewhere in allusion to this verse: Bring my soul out of prison, that I may give thanks to Thy name; the righteous shall crown themselves because of me; for Thou wilt deal bountifully with me (Ps. 142:8). Bring my soul out of prison refers to Noah, who was imprisoned in the ark. R. Levi said: Neither Noah nor his sons were able to sleep during the entire twelve months (in the ark) because they were obliged to feed the animals, the beasts, and the birds. R. Akiba stated that they even brought into the ark tree branches for the elephants and glass beads for the ostriches. Some of the animals had to be fed at the second hour in the night and others at the third hour of the night.
Midrash Tanchuma
R. Huna said in the name of R. Yosé: He left the ark coughing and spitting blood because of a cold he had contracted, and it is for this reason that Scripture states: Bring out of prison my soul … the righteous shall crown themselves because of Me (Ps. 142:8), that is, through me the Holy One blessed be He took a crown. They shall reason: Though Noah was righteous, he was not wholly righteous. The Holy One, blessed be He, nevertheless performed miracles in his behalf, as it is said: He delivereth him that is innocent (Job 22:30). In this verse i-naki (“innocent”) should be interpreted as velo naki, that is, he was not wholly righteous. How many more miracles would He have performed in his behalf if he had been wholly righteous!