The full proverb for the expression “to set one’s teeth on edge”, as quoted by the prophet Jeremiah, ran, “The fathers have eaten a sour grape, and the children’s teeth are set on edge.”
The thought of the proverb was that children would suffer from the iniquities of the father, a thought denied by the prophet, Ezekiel, who quoted the same proverb.
This very ancient saying has nothing to do with our use of the expression, “sour grapes,” but referred rather to the physical effect from eating anything as tart as unripe grapes, a tingling that seems to disturb the very edges of the teeth.
Shakespeare, in Henry IV, gave us the figurative meaning that anything jarring to the sensibilities, such as “mincing Poetrie,” sets one’s teeth on edge.