וַיִּתְחַתֵּ֣ן שְׁלֹמֹ֔ה אֶת־פַּרְעֹ֖ה מֶ֣לֶךְ מִצְרָ֑יִם וַיִּקַּ֣ח אֶת־בַּת־פַּרְעֹ֗ה וַיְבִיאֶ֙הָ֙ אֶל־עִ֣יר דָּוִ֔ד עַ֣ד כַּלֹּת֗וֹ לִבְנ֤וֹת אֶת־בֵּיתוֹ֙ וְאֶת־בֵּ֣ית יְהוָ֔ה וְאֶת־חוֹמַ֥ת יְרוּשָׁלִַ֖ם סָבִֽיב׃
Salomone si imparentò con il Faraone, re d'Egitto: prese in moglie la figlia del Faraone e la condusse nella città di Davide, finché non ebbe finito di costruire la propria casa, la casa del Signore e le mura intorno a Gerusalemme.
Rashi
Shlomo became the son-in-law. As long as Shim’i, his teacher, was alive, he did not enter into marriage [with Pharaoh’s daughter]. From here, [our Sages derived and] declared, that a person should always live in the vicinity of his teacher.1Based on the juxtaposition of Shimi’s death and Shlomo’s marriage to Pharaoh’s daughter. See Maseches Berachos 8a.2In order to remain under his teacher’s guidance and influence.
Rashi
Until he finished building, etc. And afterwards he built a house for her.3Alternatively, after he finished building the Beis Hamikdosh, Shlomo moved Pharaoh’s daughter out of the City of Dovid which had become sanctified by the presence of the Ark.—Radak