Last week a judge confirmed the city of Stockton, California’s bankruptcy exit plan.  The Wall Street Journal covered the decision and highlights some questions many raise about public-sector bankruptcies.

Stockton declared Chapter 9 bankruptcy in 2012, and it has since rewritten labor contracts and asked creditors for writedowns. Yet after being browbeaten by the California Public Employees’ Retirement System (Calpers), the giant public-pension fund, the city held pensions harmless. Calpers argued that the California constitution’s guarantee of contracts shielded pensions from cuts in bankruptcy. The fund also asserted sovereign immunity and police powers as an “arm of the state,” including a lien on municipal assets.

Judge Klein upheld Stockton’s bankruptcy plan but not before effectively throwing Calpers out of court. “It is doubtful that CalPERS even has standing,” he writes. “It does not bear financial risk from reductions by the City in its funding payments because state law requires CalPERS to pass along the reductions to pensioners in the form of reduced pensions.”

As the judge explains, “CalPERS has bullied its way about in this case with an iron fist.” Calpers’s arguments are “constitutionally infirm in the face of the exclusive power of Congress to enact uniform laws on the subject of bankruptcy under Article I, Section 8, of the U.S. Constitution—the essence of which laws is the impairment of contracts—and of the Supremacy Clause.”

The Supremacy Clause holds federal law superior to state statutes as long as the feds don’t violate state powers under the Constitution. The judge notes that states act merely as “gatekeepers” to Chapter 9 bankruptcy. Once states authorize municipalities to file for bankruptcy, they hand over custody to federal courts. Thus, as “a matter of law, the City’s pension administration contract with CalPERS, as well as the City-sponsored pensions themselves, may be adjusted as part of a chapter 9 plan.”

What all this means is that Calpers can’t stop cities from modifying pensions in bankruptcy. This has ramifications across the U.S. because unions are trying to make public pension benefits inviolable as a matter of constitutional law. If that view prevails, then politicians can make irresponsible deals to get elected that no future politicians can rescind even if they become unaffordable. Illinois is currently ground zero in this showdown.

Judge Klein also noted that California’s Supreme Court has recognized an “unusually inflexible ‘vested right’ in public employee pension benefits” that stands in contrast to the U.S. Supreme Court’s “less rigid view of the extent of a ‘vested right’ in retiree benefits,” as delivered in last month’s M&G Polymers v. Tackett ruling. Judge Klein adds that California courts’ interpretation of vested rights “encourages dysfunctional strategies to circumvent limitation and peculiarities in California public finance.”

You can say that again. The judge seems to be inviting a legal challenge to California’s vested-rights doctrine, and someone should take him up on it. Meantime, Calpers would do better by raising its investment returns rather than going to court to raid taxpayers.