Only days before winning the Democratic primary for mayor, Bill de Blasio, in his capacity as public advocate, called on a federal judge not to postpone reforms she ordered in the landmark stop-and-frisk case while the Bloomberg administration appeals it.

“Contrary to the city’s contentions, the constitutional rights of New Yorkers should weigh heaviest in the court’s decision whether to stay its remedies order,” the lefty Democrat wrote in a Sept. 6 letter to Manhattan federal Judge Shira Scheindlin.

“A stay … will result in irreparable harm to the citizenry of New York by allowing the unconstitutional stop and frisk violations of untold numbers of people to continue, especially and disproportionately in communities of color.”

The news of de Blasio’s letter wasn’t well received by NYPD union honchos — especially since he’s a front-runner to be the city’s next mayor.

“If elected, it will be interesting to see how de Blasio’s policing strategies evolve as he moves from throwing the rocks at the glass house into residing in the glass house.” said Michael Palladino, president of the Detectives’ Endowment Association.