Is potassium nitrate a safe food preservative?

According to Wikipedia, in the process of food preservation, potassium nitrate is a common ingredient of salted meat, but there are theories indicating that using nitrates in meats can cause cancer. As a preservative it can be known as E252.

I am unsure about potassium nitrate, but sodium nitrate has been marked as something we should avoid, but it actually has beneficial properties despite what some "studies" say, it in moderate does is nothing to fear, but instead may be beneficial. Potassium nitrate is still a mystery to me though, i plan to look into though eventually.