When is it appropriate to curse?

Topic Suggestion/Request:
(should match post title)

When is it appropriate to curse?

Reasoning:
(why should this be covered)

I recently heard a pastor claim that, in the psalms, David acted in direct contradiction to Christ’s teachings on blessing your enemies rather than cursing them. Obviously, this is pitting scripture against scripture, so where is the line especially in more personal circumstances like that which David faced?

The particular example that was given was Ps 55:12-15.