The title of the psalm states that it was written by David after his battle with Goliath .
The Greek version of the psalm says that it was written by King David after his battle with Goliath .