Woofgang is right; green potatoes, shoots and haulms are poisonous; but it's generally safe to let pigs root around for a while in a newly harvested field , to find what they can, because one or two green potatoes etc won't give them alkaloid poisoning.They can deal with small amounts. The bigger problem is that they don't digest potato starch well. If they 'eat like pigs' and have lot of potatoes they'll suffer digestion troubles.
fred is right, pigs will root around for and eat potatoes but potatoes are more nutritious for pigs when cooked. They will also find lots of other roots such as dock and bracken if present and remove them quite efficiently. However some pigs are very good at escaping and will jump over or charge through electric fences just because they can, so keep these well fenced in.