Is there a precedent of an election being called of or postponed due to terrorist related violence?
Israel had primary elections for the Israeli Labor Party delayed by 24 hours because of security concerns - it clashed with a Britney Spears concert, and the police couldn't provide security for both. Israel suffers from terrorism, so it is likely the security concerns for the elections were terrorism-related.
Britney Spears is set to perform in Tel Aviv on July 3, which was the same day Israeli Labor Party had planned to hold its leadership election. But citing a lack of security to cover both events, the election has now been pushed back 24 hours.
This seems to be quite rare and after doing a quick Wikipedia search using the keywords – "election", "postponed" and "terrorism", only the 2015 Nigerian general election seems relevant.
Basically, Nigeria postponed its general election by 6 weeks in 2015 due to security fears and threats of violence.
As quoted from this BBC article:
Election commission chief Attahiru Jega said the delay until 28 March was necessary because of a lack of troops available to protect voters.
Nigeria's military has been battling an insurgency by Boko Haram militants in the north-east of the country.
[ ... ]
The Boko Haram conflict has raged for five years but just days before the vote, Professor Jega was suddenly told the entire military would be focused solely on the north-east - in other words, "you are getting no help from the military, you are on your own". With the threat of violence so real, he was put in a tight corner.