The song was originally released in 1931, while in the Star Trek universe it was apparently released earlier. The original recording featured the voice of Bing Crosby; Dean Martin recorded a version of the song in 1958.
Due to copyright issues, the original Ray Noble recording of "Goodnight Sweetheart" was replaced during the 1980s by another version for VHS and Laserdisc releases. However, Paramount's 1980 "Television Classics" home video release of this episode retains the original recording. Eventually this was corrected for the DVD release. New music was also composed for this episode, incorporating the song, but the composer of this music is not credited. (X)