AIMS To investigate whether polycystic ovary syndrome further increases postpartum diabetes risk in women with gestational diabetes mellitus and to explore relationships between polycystic ovary syndrome and incident diabetes in women who do not develop gestational diabetes. METHODS This retrospective cohort study (Quebec Physician Services Claims; Hospitalization Discharge Databases; Birth and Death registries) included 34 686 women with gestational diabetes during pregnancy (live birth), matched 1:1 to women without gestational diabetes by age group, year of delivery and health region. Diagnostic codes were used to define polycystic ovary syndrome and incident diabetes. Cox regression models were used to examine associations between polycystic ovary syndrome and incident diabetes. RESULTS Polycystic ovary syndrome was present in 1.5% of women with gestational diabetes and 1.2% of women without gestational diabetes. There were more younger mothers and mothers who were not of white European ancestry among those with polycystic ovary syndrome. Those with polycystic ovary syndrome more often had a comorbidity and a lower proportion had a previous pregnancy. Polycystic ovary syndrome was associated with incident diabetes (hazard ratio 1.52; 95% CI 1.27, 1.82) among women with gestational diabetes. No conclusive associations between polycystic ovary syndrome and diabetes were identified (hazard ratio 0.94; 95% CI 0.39, 2.27) in women without gestational diabetes. CONCLUSION In women with gestational diabetes, polycystic ovary syndrome confers additional risk for incident diabetes postpartum. In women without gestational diabetes, an association between PCOS and incident diabetes was not observed. Given the already elevated risk of diabetes in women with a history of gestational diabetes, a history of both polycystic ovary syndrome and gestational diabetes signal a critical need for diabetes surveillance and prevention.