You dont even have to worry only about your own/current government. Take the Netherlands, with detailed census data (conveniently as punchcards) about their population before the German invasion. With the threat of an invasion looming some suggested to at least trike out the information about religious believes. Unfortunately this didnt happen. Amsterdam had one of the highest rates of deported Jews for a reason.