In his Expositions on the Psalms, Augustine (354-430 AD) writes the following regarding Psalm 45:1:
Augustine - Exposition on Psalm 45
4 "Mine heart has uttered a good word" (Psalm 45:1). Who is the speaker? The Father, or the Prophet? For some understand it to be the Person of the Father, which says, "Mine heart has uttered a good word", intimating to us a certain unspeakable generation. Lest you should haply think something to have been taken unto Him, out of which God should beget the Son (just as man takes something to himself out of which he begets children, that is to say, an union of marriage, without which man cannot beget offspring), lest then you should think that God stood in need of any nuptial union, to beget the Son, he says, "Mine heart has uttered a good word". This very day your heart, O man, begets a counsel, and requires no wife: by the counsel, so born of your heart, you build something or other, and before that building subsists, the design subsists; and that which you are about to produce, exists already in that by which you are going to produce it; and you praise the fabric that as yet is not existing, not yet in the visible form of a building, but on the projecting of a design: nor does any one else praise your design, unless either you show it to him, or he sees what you have done.
If then by the Word "all things were made", (John 1:3) and the Word is of God, consider the fabric reared by the Word, and learn from that building to admire His counsels! What manner of Word is that by which heaven and earth were made; (Hebrews 11:3) and all the splendour of the heavens; all the fertility of the earth; the expanse of the sea; the wide diffusion of air; the brightness of the constellations; the light of sun and moon? These are visible things: rise above these also; think of the Angels, "Principalities, Thrones, Dominions, and Powers" (Colossians 1:16). All were made by Him. How then were these good things made? Because there was uttered forth 'a good Word,' by which they were to be made.
Above, Augustine presents an interpretation of Psalm 45:1 as a reference to the eternal generation of the Son from the Father.
The passage in question says:
Psalm 45:1-3 (NRSVUE)
1 My heart overflows with a goodly theme;
I address my verses to the king;
my tongue is like the pen of a ready scribe.
2 You are the most handsome of men;
grace is poured upon your lips;
therefore God has blessed you forever.
3 Gird your sword on your thigh, O mighty one,
in your glory and majesty.
This Psalm is applied to Jesus by the author of Hebrews (Hebrews 1:8-9), so it would be valid to say that the "king" in verse 1 is the Messiah. But, establishing that God is speaking in verse 1, and that "my heart overflows with a goodly theme" refers to His eternal begetting of the Son of God, is importing far too much external theology into the text.
It is difficult to address this kind of esoteric or allegorical reading of the text, because this method is concerned with mining the text for hidden or "deeper" meaning, and as such, in most cases, the only response available to a person is for them to say that they are not compelled by whatever point the author is trying to draw out of the text.
However, it is generally true that someone can recognize when an author is clearly importing their theology into a verse, when the verse itself is a rather straightforward statement of something entirely different, and this interpretation of Psalm 45:1 fits under that category. The early Christians who believed in eternal generation were looking for verses to support the doctrine, because the doctrine is not taught explicitly in any clear statement in the Bible. However, one can look at an interpretation like this, and then recognize that if God intended to teach the doctrine of eternal generation, it would be taught clearly in a didactic or doctrinal section of Scripture, and would not need to be deduced from a contentious and esoteric understanding of a passage in Psalms.