There was a time, way back in 2013, that Mayor Bill de Blasio took a pragmatic approach to the state Senate.

At the time, the Senate was ruled by an unusual coalition of Republicans and a faction of breakaway Democrats known as the Independent Democratic Conference.

The rookie mayor traveled to the Capitol, dutifully appearing at functions with the IDC, including its leader, Bronx Sen. Jeff Klein.

It made sense. After all, the Republicans in the state Senate looked askance at de Blasio, especially compared to his predecessor, Michael Bloomberg, who bolster the GOP’s power with a $1 million donation to the conference’s soft-money coffers.

Albany is a strange, internecine place for anyone who to navigate — stymieing mayors, journalists, lawmakers, advocates and even governors. De Blasio is not the first New York City mayor to be confounded by the state Capitol and he won’t be last.

De Blasio, of course, did not have Bloomberg’s money, nor did he share the politics of Senate Republicans.

And the mayor, betting on the state’s ongoing demographic shift, sought to change how Albany functioned by flipping the Senate. He picked the wrong year: Democrats did not gain a working majority in 2014 that was enough to overcome the IDC-GOP alliance and the effort led to an investigation into campaign finance practices surrounding the funneling of money to upstate Democratic committees.

In turn, Senate Republicans sought to use de Blasio as an all-purpose boogeyman in suburban and upstate races — a plan that drew less and less potency for a mayor who is little known or covered outside of the New York City media market.

Policy-wise, de Blasio still had to find allies in Albany. He wanted a surcharge to pay for universal pre-K, putting him at odds with Gov. Andrew Cuomo.

Often, the mayor was handed half a loaf. Universal pre-K was achieved, but with the guts of Cuomo’s plan. Mayoral control of New York City schools was extended, but often with strings attached or on the basis of a year or two, ensuring he would have to return to the Capitol and lobby lawmakers once again.

Even a city-state like New York City must still bend the knee in Albany, a product of the state’s home-rule laws and a frustration for borough residents who wonder why things like speed limits on city streets can be decided and used as leverage by lawmakers who represent Binghamton.

The two men in the early going sought to emphasize, often at unconvincing pains, to show what great friends they were dating back to their time at the Department of Housing and Urban Development.

But cracks were forming even as this played out: de Blasio appeared at a rally one day in Albany for public school teachers; Cuomo was down the block for a rally with charter school advocates.

Eventually it all culminated with de Blasio’s appearance on NY1 to blast Cuomo in unusually hot rhetoric, accusing him of propping up Republicans in the state Senate. And then de Blasio… went on vacation.

Cuomo, who has a determiantion that can make the killer robots from the Terminator movies seem like dilettantes, seemed almost laser focused on suffocating anything the mayor wanted done. Yielding those early days of The Feud to Cuomo, who has a long memory, was seen as a head-scratching decision.

The Feud became the background music for every interaction between the two men, the pretext for Cynthia Nixon’s primary challenge last year and veered into a Veep-like farce when the two scuffled publicly over the fate of deer that led to the poor animal’s demise.

Now The Feud has dissipated, sort of. De Blasio backed Cuomo on the ill-fated Amazon project. He backed the governor on congestion pricing. He got his extension of mayoral control in the state budget, taking one more thing off his plate as he runs for president.

But the Capitol, now with a Democratic state Senate, is negotiating an extension of rent control laws and could potentially strengthen and expand them for a city in which the cost of housing has skyrocketed.

Publicly the task has been left to Council Speaker Corey Johnson, who has made treks to Albany to discuss the issue as the session winds down over the next five weeks.

De Blasio finally got the Democratic state Senate he wanted. This weekend he’ll be Iowa.