וַיִּתְחַתֵּ֣ן שְׁלֹמֹ֔ה אֶת־פַּרְעֹ֖ה מֶ֣לֶךְ מִצְרָ֑יִם וַיִּקַּ֣ח אֶת־בַּת־פַּרְעֹ֗ה וַיְבִיאֶ֙הָ֙ אֶל־עִ֣יר דָּוִ֔ד עַ֣ד כַּלֹּת֗וֹ לִבְנ֤וֹת אֶת־בֵּיתוֹ֙ וְאֶת־בֵּ֣ית יְהוָ֔ה וְאֶת־חוֹמַ֥ת יְרוּשָׁלִַ֖ם סָבִֽיב׃
所羅門與埃及王法老結為姻親,娶了法老的女兒,把她帶到大衛城,直到他建造完自己的宮殿、永恆者的殿和耶路撒冷四圍的城牆。
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