לִשְׁלֹמֹ֨ה ׀ אֱֽלֹהִ֗ים מִ֭שְׁפָּטֶיךָ לְמֶ֣לֶךְ תֵּ֑ן וְצִדְקָתְךָ֥ לְבֶן־מֶֽלֶךְ׃
פֿון שלמהן. גאָט, גיב דײַנע משפּטים צום מלך, און דײַן גערעכטיקײט צום מלכס זון;
Rashi
Concerning Solomon He prayed this prayer on behalf of his son Solomon, for he foresaw with the holy spirit that he [Solomon] was destined to request of the Holy One, blessed be He, “a heart to understand, to hear judgment.”
Rashi
Your judgments the wisdom of Your laws, which You commanded in the Torah.
Rashi
to a king, etc., to a king’s son Both refer to Solomon. Another explanation: Give Your judgments to a king The chastisements should end with me, and the charity You should bestow upon my son; viz. that there be peace in his days.