As if he didn't have enough on his in-tray trying to sort out the mess over women bishops, the government's decision to permit same-sex marriage in church will create more problems for the incoming Archbishop of Canterbury, Justin Welby.
When his appointment was announced, Welby was widely described as being a "staunch" opponent of same-sex marriage . But he has never used the language of, say, the Archbishop of York John Sentamu, who once claimed that to allow gay couples to get married would be to "torture the English language." Instead, during his first press conference Welby promised to  "listen very attentively to the LGBT communities and examine my own thinking prayerfully." But however his own thinking evolves, the change will inevitably call into question both the unity of the Church of England and its relationship with wider society.
As the women's bishops debate also showed, the church can't afford to get too out of step with the nation from which it takes its name. When it does, it raises awkward questions about its constitutional status and privileges, even about what it is for.
The Church's official position, as set out in its response  to the government's consultation earlier this year, is to oppose any move towards equalisation marriage between gay and straight couples. Even the government's initial proposals, which would have prohibited any same-sex ceremonies in religious premises, went too far for the Anglican leadership. The document claimed that the change would "alter the intrinsic nature of marriage as the union of a man and a woman, as enshrined in human institutions throughout history."
It also made legal arguments, casting doubt on the government's distinction between religious and civil marriage and stressing the historic obligation of the Anglican priests to marry couples resident in their parish, whether they were members of the church or not. However, the Church of England has long had an exemption when it comes to marrying divorcees, and recently acquired one in respect of transsexuals, so there's no obvious reason why it shouldn't also have an exemption from being required to perform same-sex marriages.
The real problem for the established church - and for the new archbishop - will be internal rather than external. Instead of vicars being forced by the state to perform gay marriages against their conscience, a more likely scenario will see clergy banned by the church from following their conscience by performing them. The official statement was not universally welcomed by Anglicans. Many, in fact, denounced it. The liberal grouping Inclusive Church put in its own submission , describing the ability of churches to offer same-sex ceremonies "a fundamental principle of religious liberty." It was "of the utmost importance that objections to the principle of same-sex marriages by some religious groups should not be used as an excuse to obstruct other groups from acting in accordance with their own religious views." Giles Fraser, perhaps the Church's highest-profile liberal, declared that he was "spitting blood" after reading the "ridiculous" official response , which he thought had "all the democratic authority of a Putin election victory."
Such views probably still represent a minority view among practising Anglicans, in contrast to the push for women bishops - which, despite the disappointing outcome of the recent Synod vote, has clear majority support inside the church. And as that vote showed, it's quite easy for opponents of change to put together a blocking minority in the Synod. So it's hard to see a proposal to permit same-sex marriage winning the necessary two-thirds majority in all three houses. It's very likely that religious organisations will be allowed to offer same-sex weddings on the same terms that they can already offer civil partnerships: that is, only if the group as a whole decides to accept it. Individual priests will not be able to make the decision unilaterally.
The Church of England officially supports civil partnerships but, unlike some other religious groups including the Quakers and the United Reformed Church, has made no move to permit the ceremonies in its churches. Once same sex marriage becomes widely accepted, as it surely will once the doom-laden predictions of its opponents prove unfounded, this is likely to change. There will be increasingly vocal calls from liberal clergy to marry same sex couples. In Denmark , the national Lutheran Church already performs same sex weddings, with exemptions for individual ministers who have an objection. Such a solution could also work in the Church of England. But not before another almighty row between the C of E's liberals and conservatives. It may end up dominating Justin Welby's tenure as archbishop in the way that the women bishops debate has dominated Rowan Williams'.