I had a coworker who took them her whole pregnancy her son is fine. I take oxycodone twice a day for fibromyalgia. Oxycodone is way stronger when I first got pregnant I quit cold turkey but was put back on them just a lower dose. Doctors go to school for years they know what they are doing.
Talk to your ob-gyn. An infection shouldn't be treated with painkillers, but with antibiotics or by pulling the tooth or both, but if the painkiller is going along with that, make sure the dentist knows you are pregnant and talk to the doctor who is managing your pregnancy care also.
I took them for about a month in my first pregnancy because I had to have surgery. I was also iffy about it but my midwife assured me that taking the Vicodin would do a lot less harm to my baby than the stress of how much pain I was in would do. My mom also took them her entire pregnancy with my little sister and she's perfectly fine. Hope this helps. :)
I took them whilst in the hospital for a surgery and was also prescribed some. I was kinda iffy about it but had to remind myself that my doctor wouldn't give me anything that could potentially harm my baby. I also did research about it and read that it is in fact safe. Hope this helps.