“I don't think anyone in this courtroom seriously thought the city was anything but insolvent,” Judge Meredith Jury said Wednesday in granting San Bernardino bankruptcy protection, and then set her sights on the city’s largest creditor, the California Public Employees’ Retirement System (CalPERS).

“If CalPERS gets all the money they want, under what they say is their statutory right, who isn't going to get paid? All the employees? How is that going to help CalPERS?” she said.

And thus the stage was set for a showdown between bondholders, pensioners and the city over who gets the table scraps left one year after San Bernardino declared itself broke, with a budget deficit of $45.8 million. Other cities facing bankruptcy, like Stockton and Detroit, are watching to see how the conflict plays out.

Stockton declared bankruptcy in 2012, but has continued to pay into the pension system. However, the judge in that case said the pension fund will probably be an important issue in the city’s restructuring plan.

CalPERS officials maintain that state law demands that they be paid in full for obligations incurred by the city, while the city and bondholders insist that they duke it out in court and settle for whatever the judge awards them. CalPERS sees that as a dangerous precedent that would encourage other cities, battered by the economic downturn that started in 2008, to use bankruptcy to halt their payments, and endanger the nation’s second-largest pension fund.

The San Bernardino Sun quoted a response from the city’s bankruptcy attorney, Paul Glassman, who said he was reading the words of City Attorney James F. Penman: “It’s an emergency room, not a health spa. And to suggest that a city would subject itself to the process unless it had to is disingenuous.”

After initially halting payments to CalPERS when it filed for bankruptcy, San Bernardino resumed them but refused to reimburse the pension fund for the months it had missed. CALPERS opposed the bankruptcy and is demanding the money.

San Bernardino officials claimed the city had just $4.2 million on hand in January and couldn’t make the $1.2 million biweekly payments to the pension fund, much less pay back bondholders. Holders and insurers of $50 million worth of bonds issued by San Bernardino have demanded that the city gut municipal services, raise taxes and forego payments to CalPERS.

The bankruptcy proceedings are taking place as November elections approach and a massive recall of city officials moves forward. That, and uncertainty about just how much money CalPERS wants, prompted the city to request a delay in negotiations involving a mediator until December at the earliest.

Judge Jury said no and set a September 4 date for deciding on a timetable.