OPINION OF THE COURT
R.S. Smith, J.We hold that New York City’s Equal Benefits Law is preempted by state and federal statutes. We therefore affirm the Appellate Division’s dismissal of a CPLR article 78 proceeding brought by the New York City Council to compel enforcement of that law.
Facts and Procedural History
The Equal Benefits Law (Administrative Code of City of NY § 6-126) was enacted by the City Council in 2004 over the Mayor’s veto. It provides, in substance, that no city agency may enter into contracts having a value of $100,000 or more annu*387ally with any person or firm that fails to provide to its employees’ domestic partners employment benefits equal to those provided to spouses. “Domestic partners,” as defined in the Equal Benefits Law, means people who are registered as having that status under Administrative Code § 3-240 (a), or who register with a contractor pursuant to the Equal Benefits Law itself (Administrative Code § 6-126 [b] [5]). “Employment benefits,” as used in the Equal Benefits Law,
“means benefits including, but not limited to, health insurance, pension, retirement, disability and life insurance, family, medical, parental, bereavement and other leave policies, tuition reimbursement, legal assistance, adoption assistance, dependent care insurance, moving and other relocation expenses, membership or membership discounts, and travel benefits provided by a contractor to its employees” (Administrative Code § 6-126 [b] [7]).
Shortly before the Equal Benefits Law’s effective date, the Mayor began a declaratory judgment action against the Council, asserting that the law was inconsistent with, and therefore preempted by, provisions of the General Municipal Law and the New York City Charter relating to municipal contracting; that it was also preempted by the federal Employee Retirement Income Security Act of 1974 (29 USC § 1001 et seq. [ERISA]); and that it was invalid because it curtailed the Mayor’s powers without a referendum, in violation of the Municipal Home Rule Law and City Charter. After unsuccessfully seeking a temporary restraining order against the law’s enforcement, the Mayor, through his counsel, informed Supreme Court that he would withdraw his motion for a preliminary injunction, that he would move promptly for summary judgment, and that in the meanwhile he would “comply with controlling state laws concerning procurement and the Charter”—i.e., that he would not implement the Equal Benefits Law. The next day, the Council began this CPLR article 78 proceeding, in the nature of mandamus to compel, against the Mayor and the City, asking for a judgment requiring them “immediately to implement and enforce the Equal Benefits Law.” In response, the Mayor asserted, as he had in the declaratory judgment action, his reasons for considering the law invalid.
Supreme Court granted the petition without addressing the Mayor’s arguments, relying on “the presumption of validity.” The Appellate Division concluded that the Equal Benefits Law *388was preempted by both the General Municipal Law and ERISA, and dismissed the proceeding on that basis. We now affirm.
Discussion
I
The Council argues that we should grant its petition and order the Equal Benefits Law enforced without considering the merits of the controversy, on the ground that the validity of a legislative enactment cannot be decided in an article 78 proceeding. The Council’s argument is misconceived.
The rule relied on by the Council that “article 78 does not lie to challenge a legislative act” (New York City Health & Hosps. Corp. v McBarnette, 84 NY2d 194, 201 [1994]) means that a petitioner who is challenging the validity of legislation may not use an article 78 proceeding for that purpose; a lawsuit to challenge the validity of legislation should take the form of an action for a declaratory judgment. (See also Press v County of Monroe, 50 NY2d 695, 702 [1980]; Matter of Kovarsky v Housing & Dev. Admin. of City of N.Y., 31 NY2d 184, 192 [1972].) It does not mean that, when an article 78 proceeding is brought to compel the enforcement of legislation the petitioner claims is valid, the court must grant the petition whether the legislation is valid or not.
On the contrary, article 78 relief in the form of mandamus to compel may be granted only where a petitioner establishes a “clear legal right” to the relief requested (Matter of Brusco v Braun, 84 NY2d 674, 679 [1994]). And we have repeatedly held that an officer against whom a proceeding for a writ of mandamus is brought may defend on the ground that the legislation he or she has been asked to enforce is invalid (Matter of Carow v Board of Educ. of City of N.Y., 272 NY 341, 345 [1936]; People ex rel. Balcom v Mosher, 163 NY 32, 35 [1900]). The theory the Council advocates would put the courts in the unacceptable position of directing an officer to violate his or her oath of office by enforcing an unconstitutional law, and would contradict the principle that “mandamus is never granted for the purpose of compelling the performance of an unlawful act” (Matter of People ex rel. Sherwood v State Bd. of Canvassers, 129 NY 360, 370 [1891]).
Thus we hold that the Appellate Division was correct in concluding that the Mayor was entitled to raise the invalidity of the Equal Benefits Law as a defense in this case. We are not *389persuaded by our dissenting colleagues’ arguments to the contrary.
The dissent asserts, without citation of authority, that the Mayor’s duty is to “follow a duly enacted law . . . unless and until a court nullifies it” (dissenting op at 396). The assertion has a circular quality, for how can a law be “duly enacted” if the legislature that enacted it had no authority to do so? The Mayor does indeed have a duty to implement valid legislation passed by the City Council, whether over his veto or not, but he also has a duty to comply with valid state and federal legislation, including state competitive bidding laws and ERISA. Where a local law seems to the Mayor to conflict with a state or federal one, the Mayor’s obligation is to obey the latter, as the Mayor has done here.
The dissent suggests that the procedural characteristics of an article 78 proceeding make it unsuitable for resolving the Mayor’s contention that the Equal Benefits Law is invalid (dissenting op at 401-402). The suggestion is puzzling. Article 78 proceedings are indeed designed for the prompt resolution of largely legal issues, rather than for discovery, trials and “credibility judgments” (id. at 400), but, as we explain below, the validity of the Equal Benefits Law turns entirely on issues of law, not of fact. The dissent says that the likely fiscal impact of the Equal Benefits Law presents an issue of fact (id. at 399) but, as the next section of our opinion explains, it is not an issue sufficient to defeat summary judgment in this case. We assume the accuracy of the Council’s assertion that the law will “not cost contractors much money” (id. at 400). We conclude that the law is nevertheless preempted by the competitive bidding statute.
The dissent seems to shrink, understandably, from following to the limits of its logic the proposition that an executive must implement every law, valid or invalid, that a legislative body enacts until a court determines the law’s validity. Certainly, the dissenters would not so hold in an extreme case: If a legislative body enacted a law requiring racial segregation of public schools, the dissenters would not say that it is the duty of police to bar black children from “white” schools until a court orders them let in. And even in this case, the dissent stops short of saying that the relief the Council seeks in this article 78 proceeding—an order requiring implementation of the Equal Benefits Law, issued without considering the law’s validity—should be granted. The dissenters say only that they would “reverse the order of the Appellate Division and allow the declaratory judg*390ment action to proceed.” (dissenting op at 403)—so that the article 78 proceeding would presumably remain in limbo until the declaratory judgment action is decided. All that means, in this case, is that the parties would make, and the courts would resolve, exactly the same arguments the parties make here, but under a different caption. We decline to order such a purposeless exercise, and we proceed to consider whether the Mayor can be ordered to enforce the Equal Benefits Law.
II
We agree with the Appellate Division that the Council’s article 78 proceeding must be dismissed because the Equal Benefits Law conflicts with, and is therefore preempted by, General Municipal Law § 103.
Under section 103 (1), “all contracts for public work involving an expenditure of more than twenty thousand dollars and all purchase contracts involving an expenditure of more than ten thousand dollars, shall be awarded ... to the lowest responsible bidder . . . .” The Mayor argues, and we hold, that the Equal Benefits Law violates this requirement by excluding from public contracting any “responsible bidder” that does not provide equal benefits to domestic partners and spouses.
Associated Bldrs. & Contrs. v City of Rochester (67 NY2d 854 [1986]) is the controlling authority. That case involved a City of Rochester ordinance providing that in awarding municipal construction contracts in excess of $100,000, preference must be given to a contractor whose employees participated in a state-approved apprenticeship program. We held that, in view of section 103’s predominant purpose of “protection of the public fisc by requiring competitive bidding,” the ordinance could not stand (id. at 856). We acknowledged that the apprentice training that the Rochester ordinance sought to promote was “a desirable end,” but held it was not one that could “affect the qualification of an otherwise responsible low bidder” (id.). That logic is dispositive in this case. The provision of equal benefits for domestic partners and spouses may be a desirable end, but it is not one that New York City is free to pursue by departing from the requirements of the competitive bidding statute.
The Council argues that the Equal Benefits Law will not undermine the purposes of competitive bidding, because, the Council says, the economic impact of the Equal Benefits Law will be de minimis. The Council asserts, and we assume, that the cost of providing equal benefits to domestic partners and to *391spouses will be close to zero. But the competitive bidding statute does not become inapplicable when the sums saved by complying with it are immaterial.
Apart from its purely financial effect, competitive bidding serves to prevent “favoritism, improvidence, fraud and corruption in the awarding of public contracts” (Matter of New York State Ch., Inc., Associated Gen. Contrs. of Am. v New York State Thruway Auth., 88 NY2d 56, 68 [1996]). If municipalities are free to contract only with firms that provide certain benefits to their employees, the door is open at least to favoritism, for the municipality could design its requirements to match the benefit structure of the bidder it favored. No such thing has happened in this case, of course; we have no doubt that the Equal Benefits Law is a good faith effort to make contractors treat the domestic partners of employees in a way that the Council considers fair. But the competitive bidding statute reflects a judgment by the State Legislature that, to avoid among other things the risk of favoritism, municipalities must give business to the lowest responsible bidder, whether the bidder’s benefit plans meet the municipality’s idea of fairness or not.
The Council says that the validity of the Equal Benefits Law finds support in the New York State Chapter case; in McMillen v Browne (14 NY2d 326 [1964]); and in the home rule provisions of the State Constitution and implementing legislation. None of these is a sufficient basis for upholding the law.
In New York State Chapter, we held that entities governed by competitive bidding requirements could, under some circumstances, adopt so-called project labor agreements (PLAs), providing that bidders for public construction contracts must sign prenegotiated labor agreements or be barred from bidding. We did not hold, however, that public entities could enter into PLAs as a means of assuring fair treatment to contractors’ employees. Indeed, we said that “PLAs that do have as their purpose social policymaking, such as remedying racial and gender bias, will not be sustained” (88 NY2d at 76). But we recognized that, while PLAs “have an anticompetitive impact on the bidding process,” they also brought economic benefits to the contracting authority, in that “the union promises labor peace through the life of the contract” (id. at 65). We held that the resulting “efficiencies to be gained” (id.) might justify a PLA under the competitive bidding laws. We said that a PLA would be upheld only if it “had as its purpose and likely effect the advancement of the interests embodied in the competitive bidding statutes” (id. at *39269), which we identified as “prudent use of public moneys and . . . the acquisition of high quality goods and services at the lowest possible cost” (id. at 67).
In other words, under New York State Chapter, PLAs and other procedures having an anticompetitive effect on the bidding process can be justified only by proof that they are designed to save the public money by causing contracts to be performed at smaller cost or without disruption. No such justification can be convincingly claimed for the Equal Benefits Law. The Council says that the cost of the law will be insignificant, and will be outweighed by the benefits to the public that flow from assuring adequate health care to workers’ domestic partners, but the Council cannot and does not seriously assert that the “purpose and likely effect” of the law is to make the City’s contracts cheaper or their performance more efficient. The law—like the mayoral executive order prohibiting discrimination by city contractors based on sexual preference that was at issue in Under 21, Catholic Home Bur. for Dependent Children v City of New York (65 NY2d 344 [1985])—is obviously designed as “an enactment of social policy” (id. at 359 n 5). New York State Chapter gives no support to the view that social policy goals may trump the competitive bidding statute.
The Council relies on McMillen because in that case we upheld a local law requiring payment of a minimum wage by city contractors—a law plainly designed, as is the Equal Benefits Law, for the protection of contractors’ employees. The flaw in the Council’s argument is that McMillen had nothing to do with competitive bidding requirements; they are nowhere referred to in the decision. The issue in McMillen was whether New York City’s minimum wage requirement was preempted by the State’s prevailing wage and minimum wage laws. Our resolution of that issue is not relevant to this case.
The home rule provisions of the Constitution and the legislation implementing them list several subjects about which local governments are given the power to legislate. One of those subjects is “[t]he wages or salaries, the hours of work or labor, and the protection, welfare and safety of persons employed by any contractor or sub-contractor performing work, labor or services for [the municipality]” (NY Const, art IX, § 2 [c] [ii] [9]; Municipal Home Rule Law § 10 [1] [ii] [a] [10]). But this grant of power to municipalities is expressly made subject to contrary state legislation. The Constitution and the statute say that municipalities may adopt laws of the kind described in the *393language we have quoted “except to the extent that the legislature shall restrict the adoption of such a local law” (NY Const, art IX, § 2 [c] [ii]; Municipal Home Rule Law § 10 [1] [ii]). General Municipal Law § 103 is, as Associated Builders makes clear, just such a restriction. The requirement of section 103 that municipalities contract with the lowest responsible bidder is plainly in tension with the right of a municipality to say that it will contract only with firms that provide certain benefits. Where the two conflict, as they do here, the legislative restriction on the municipality’s power prevails.
In short, the Equal Benefits Law conflicts with General Municipal Law § 103. The City Council has not demonstrated a clear legal right to have the Equal Benefits Law enforced.
Ill
The Equal Benefits Law is also preempted by ERISA, except to the extent that it governs benefits that are outside ERISA’s scope. In so holding, we agree with two federal district courts that have addressed the validity under ERISA of local legislation similar to the Equal Benefits Law (Catholic Charities of Me., Inc. v City of Portland, 304 F Supp 2d 77, 84-93 [D Me 2004]; Air Transp. Assn. of Am. v City & County of San Francisco, 992 F Supp 1149, 1165-1180 [ND Cal 1998]).
ERISA is a federal statute that imposes disclosure and reporting requirements, and establishes standards of conduct, for employee benefit plans and their fiduciaries (see 29 USC § 1001 [b]). A consistent, nationwide regulatory scheme was clearly one of Congress’s goals, and to that end it provided that “the provisions of [ERISA] shall supersede any and all State laws insofar as they may now or hereafter relate to any employee benefit plan” of the kind governed by ERISA (29 USC § 1144 [a]). ERISA plans include, among other things, “any plan, fund, or program . . . maintained by an employer ... for the purpose of providing . . . medical, surgical, or hospital care or benefits, or benefits in the event of sickness, accident, disability, death or unemployment...” (29 USC § 1002 [1] [A]). Clearly, the coverage of ERISA overlaps substantially with the coverage of the Equal Benefits Law, though the Equal Benefits Law may apply to some benefits not governed by ERISA (see Air Transp. Assn. of Am. v City & County of San Francisco, 992 F Supp at 1169 [a law applying to “benefits that . . . require no ‘ongoing administrative program,’ . . . does not apply to a ‘plan’ and thus is not preempted”; also, “(m)oving expenses . . . are not even ERISA-covered benefits”]).
*394The broad preemptive language of 29 USC § 1144 (a), superseding all laws that “relate to any employee benefit plan,” has been held by the United States Supreme Court to be no less sweeping than it appears on its face: “A law ‘relates to’ an employee benefit plan, in the normal sense of the phrase, if it has a connection with or reference to such a plan” (Shaw v Delta Air Lines, Inc., 463 US 85, 96-97 [1983]). In Shaw, the Court struck down a New York law that prohibited discrimination in the provision of employee benefits on the basis of pregnancy. Shaw holds that states (and, of course, municipalities) cannot regulate the content of ERISA plans. That holding has been left untouched by more recent cases, which hold, in effect, that ERISA does not preempt every state law that has an indirect impact on an ERISA plan (New York State Conference of Blue Cross & Blue Shield Plans v Travelers Ins. Co., 514 US 645 [1995]; HMI Mech. Sys., Inc. v McGowan, 266 F3d 142 [2d Cir 2001]).
The Equal Benefits Law seemingly seeks to do exactly what ERISA, as interpreted in Shaw, prohibits—to prescribe the terms of benefit plans. The Council argues, however, that the prohibition is inapplicable because the Equal Benefits Law does not compel any firm to offer domestic partner benefits; it merely provides that the City will not contract with firms that do not do so. Thus, says the Council, the law does not regulate benefit plans, hut reflects a decision by the City, as a market participant, to choose the firms it deals with based on the benefits those firms provide their employees. The Council’s “market participant” argument is inconsistent with United States Supreme Court precedent.
While the Supreme Court has not addressed the market participant theory in an ERISA preemption case, it recognized a limited market participant exception to federal labor law preemption in the so-called Boston Harbor case (Building & Constr. Trades Council v Associated Builders & Contractors of Mass./R.I., Inc., 507 US 218 [1993]). Boston Harbor (like our New York State Chapter case, discussed at pages 391-392 above) involved a public agency’s practice of entering into project labor agreements that required its contractors to sign agreements with labor unions, in order to prevent a project from being disrupted by labor disputes. Under the preemptive provisions of federal labor law, a state could not impose such a requirement by statute or regulation, but the Court held in Boston Harbor that the requirement could be imposed by a state agency when *395the state is not regulating, but is acting as an owner or manager of property that “must interact with private participants in the marketplace” (507 US at 227). The Boston Harbor court recognized, as we did in New York State Chapter, that a PLA may produce economic benefits that a public proprietor, like a private proprietor, should be free to seek in the marketplace. The Court thus recognized a distinction “between government as regulator and government as proprietor” (id.).
Boston Harbor does not hold, however, that a state may escape the force of federal preemption by using its power in the marketplace to implement governmental policies. To the contrary, Boston Harbor makes clear that a state acts as a regulator, not a proprietor, when it uses its bargaining leverage as a means of attaining policy ends. Thus, the Court in Boston Harbor distinguished Wisconsin Dept. of Industry v Gould Inc. (475 US 282 [1986]), which held that certain state activity in the marketplace was preempted.
In Gould, the Court held that a Wisconsin statute barring some labor law violators from doing business with the State was preempted by federal labor law. The difference between Boston Harbor and Gould, the Court explained in Boston Harbor, is that in Gould the State’s reason for its marketplace activity was to deter labor law violations, not to protect the State’s proprietary interest in the efficient performance of contracts (507 US at 228-229). Under Boston Harbor, the market participant exception to preemption is limited to the situation where “the State acts as a market participant with no interest in setting policy” (id. at 229).
The Equal Benefits Law is much more like the statute involved in Gould than the contract specification at issue in Boston Harbor. In enacting the Equal Benefits Law the Council was obviously “setting policy.” As we pointed out above, it was not acting just as a manager or owner of property concerned with assuring the cheap and efficient performance of contracts. The Equal Benefits Law, as its name implies, is designed to induce contractors to treat domestic partners and spouses equally, just as the Wisconsin statute in Gould was designed to induce contractors to avoid unfair labor practices. Thus the market participant exception does not apply here, and the Equal Benefits Law, except to the extent that the benefits it governs are not provided through ERISA plans, is preempted by ERISA.
Accordingly, the order of the Appellate Division should be affirmed, with costs.