ALMOST all Canada’s oil and gas is landlocked, so getting it to market requires pipelines—lots of them. But building them requires skills more suited to circus artists than engineers. They must walk the financial high wire, jump through ever-changing regulatory hoops and juggle conflicting demands from environmental groups and numerous governments. The list of failures is long. It includes Northern Gateway, meant to bring Alberta crude to a port in northwestern British Columbia; Energy East, which would have linked Alberta to the Atlantic coast; Pacific Northwest, to bring gas to the west coast; and the legendary Mackenzie Valley gas pipeline, first proposed in 1974 and dropped in 2017 by its last, exhausted promoter.

Another flop is likely following the announcement this week by Kinder Morgan, one of North America’s biggest pipeline firms, that it would freeze spending on the Trans Mountain Expansion, a C$7.4bn ($5.9bn) plan to triple the capacity of an existing pipeline carrying fuel from Alberta to a port near Vancouver (see map). Steve Kean, head of Kinder Morgan, complained on April 8th that the newish government in British Columbia (BC) continued to put obstacles in the way of the project, even though it had won approvals from the previous provincial government and the federal government. Unless the governments in Victoria, BC's capital, and Ottawa sort out who has jurisdiction, and provide clarity by May 31st, the company will abandon the plan.

The chaos could be far-reaching. The failure of the Trans Mountain Expansion could provoke a constitutional crisis. It would exacerbate a tit-for-tat trade war between BC and neighbouring Alberta. It threatens to undo a carefully constructed national climate-change plan. And it may alienate foreign investors who are already pulling back from Canada.

The tussle over who has jurisdiction between the federal government and the powerful provinces goes back to Canada’s creation in 1867 and frequently ends up in court. Justin Trudeau, the prime minister, insists the pipeline is in the national interest. The constitution gives parliament the power to override provincial laws and regulations in certain instances. But governments use this power sparingly. In the 1960s, when Quebec refused to allow neighbouring Newfoundland and Labrador to send electricity through Quebec and onwards to American customers, the federal government simply stood by.

Alberta’s New Democratic government badly needs a pipeline to carry the province’s oil to the ocean to reduce its dependence on America, which buys 99% of Canada’s oil exports. Oil firms believe access to new markets would increase the price of Western Canadian Select, the country’s heavy crude, which trades at a discount to America’s lighter West Texas Intermediate benchmark because of higher transport and refining costs.

But BC’s minority New Democratic government is equally determined to placate the Greens who prop it up by honouring a pledge to block the pipeline. As a result of the tiff, Alberta temporarily suspended the import of BC wines earlier this year and is now threatening to restrict exports of petrol to the province, which the existing Trans Mountain pipeline carries in addition to light and heavy crude.

Alberta’s agreement to a national climate-change plan that includes a carbon tax was conditional on getting at least one pipeline built. The Trans Mountain Expansion was its best hope. The future of the partially built Keystone Pipeline System, which links Alberta with America, is still uncertain. Should the Trans Mountain Expansion fail, the national climate deal may too. Canada is already struggling to meet its targets. Losing Alberta could loosen constraints on greenhouse-gas emissions from the oil sands, which make up almost 10% of the national total.

Perhaps the biggest source of concern is the message to foreign investors. Last week David McKay, head of RBC, Canada’s largest bank, fretted that investment was flowing out of the energy and clean-technology sectors “in real time” because Canada was not competitive. Tax and regulatory changes are making America more attractive in comparison, says Philip Cross, an economist. Kinder Morgan wants Mr Trudeau to sort out the mess. The company is looking for “some kind of pre-emptive action” that stops BC from frustrating and opposing the project, Mr Kean told analysts. In short, he wants a ringmaster.