
60 Cal.2d 355 (1963)
OLIVE M. BENSON et al., Plaintiffs, Cross-defendants and Respondents,
v.
CITY OF LOS ANGELES et al., Defendants, Cross-defendants and Appellants; TERESA G. BENSON, Defendant, Cross-complainant and Appellant.
L. A. No. 26786. 
Supreme Court of California. In Bank.  
Aug. 27, 1963.
 Roger Arnebergh, City Attorney, Bourke Jones, John J. Tully, Jr., and Weldon L. Weber, Assistant City Attorneys, for Defendants, Cross-defendants and Appellants.
 Wendell R. Thompson, City Attorney (Pasadena), Fred R. Metheny, Assistant City Attorney, Donald B. Hagler and Evelynn M. Finn, Deputy City Attorneys, as Amici Curiae on behalf of Defendants, Cross-defendants and Appellants.
 Glenn S. Roberts and Henry W. Low for Defendant, Cross-complainant and Appellant.
 Kenneth Sperry and John L. Kaesman for Plaintiffs, Cross-defendants and Respondents.
 PEEK, J.
 Teresa G. Benson appeals from that portion of a judgment denying her the right, after the demise of her former spouse, August Benson, to receive a widow's pension from the City of Los Angeles. The city also prosecutes an appeal, but only from that portion of the judgment which awards to Olive M. Benson, the widow of August, interest on accrued pension benefits withheld by the city pending the award of the pension to Olive. The appeals arise out of an action by Olive and a cross-action by Teresa against each other and the city for declaratory relief as to their entitlement to the widow's pension in question, and for accruals of payments and interest allegedly withheld by the city.
 Teresa married August in January 1920 and resided with him in California from that date until 1945. Between 1916 *358 and 1940 August was employed by the Los Angeles Fire Department. During that time withholdings were made from his earnings in the amount of his contribution for pension benefits pursuant to provisions in the Los Angeles Charter. In 1940 he retired from active service and thereafter regular pension payments were made to him in accordance with the charter provisions.
 In 1945 August commenced an action against Teresa for divorce. She cross- complained and a decree of separate maintenance was awarded to her. In that action, although the court found that the parties were possessed of a community property interest in the pension, no division of such interest was made.
 In 1952, after moving to the District of Columbia, August commenced an action for and was granted a divorce from Teresa. She was not personally served in the District of Columbia and did not make an appearance. It does not appear that the court purported to adjudicate property matters as between the parties.
 In 1953 August married Olive and thereafter resided with her until his death in 1960.
 Shortly after August's death, and preliminary to the instant actions, both Teresa and Olive filed claims with the City of Los Angeles for the widow's pension benefits based upon August's service. The claims were denied in both instances, the city maintaining that it was obligated to neither claimant for a pension as neither was qualified under the charter provisions.
 The city's appeal, insofar as its notice of appeal discloses, is from the whole of the judgment except that portion awarding nothing to Teresa. It sought to avoid the obligation to Olive on the ground of a 1925 modification of the provisions governing the widow's pension, wherein eligibility of the widow was changed from marriage to the member of the retirement system for at least one year prior to the date of his death to marriage for at least one year prior to his retirement, which remains the current requirement. After the filing of the instant claims the modification was held in other proceedings to be invalid as to a widow of a pensioner who was a member of the retirement system prior to the modification. (Henry v. City of Los Angeles, 201 Cal.App.2d 299 [20 Cal.Rptr. 440]; Eaton v. City of Los Angeles, 201 Cal.App.2d 326 [20 Cal.Rptr. 456]; Atwell v. City of Los Angeles, 201 *359 Cal.App.2d 336 [20 Cal.Rptr. 462].) The city concedes that it may be deemed to have abandoned its appeal as to that portion of the judgment awarding a pension to Olive in the event such portion of the judgment otherwise is to be affirmed.
 The judgment of the trial court was predicated upon the finding that Olive and not Teresa is the "widow" of the deceased pensioner within the meaning of that term as used in section 4 of article XI 1/2 of the Los Angeles City Charter which, under the rule of the Henry, Eaton, and Atwell cases, must be looked to in the instant case. (Stats. 1923, pp. 1413, 1414.)
 The portion of that section relevant to the issues herein provides: "Whenever any member of the Fire or Police Department shall die ... then an annual pension shall be paid in equal monthly installments to his widow ... in an amount equal to one-half (1/2) of the salary attached to the rank or position which such deceased person held ... Provided, however, that no widow of a pensioner shall be entitled to a pension unless she shall have been married to such deceased pensioner at least one year prior to the date of his death. ..."
 Following the aforesaid modification in 1925 the governing provision became section 183, but the references therein to "widow" were not made more specific and at no time has that term been defined by a charter provision.
 The real question to be determined is whether the ordinary meaning of the term "widow" can be applied to defeat Teresa's claim in a pension earned with community funds and efforts. [1] It is established that pension rights of a municipal employee are an integral part of his earnings. (Dryden v. Board of Pension Comrs., 6 Cal.2d 575 [59 P.2d 104].) [2] Moreover, a widow's right to receive a pension after the death of her spouse is an element of her husband's contractual compensation and is earned by his performance of services for a municipality. (Henry v. City of Los Angeles, supra, 201 Cal.App.2d 299, 313.) [3] It necessarily follows that pension rights which are earned during the course of a marriage are the community property of the employee and his wife. (French v. French, 17 Cal.2d 775, 778 [112 P.2d 235, 134 A.L.R. 366]; Cheney v. City & County of San Francisco, 7 Cal.2d 565, 569 [61 P.2d 754]; Civ. Code,  164.) Furthermore, the 1947 separate maintenance decree in favor of Teresa specifically recognized that the pension benefits herein involved were community property.
 In view of the foregoing Teresa claims that she alone is entitled *360 to the community assets after August's death, and that it was a denial of due process to deprive her of such property right by an ex parte decree of divorce in a foreign jurisdiction. (See Estate of Updegraph, 199 Cal.App.2d 419, 423 [18 Cal.Rptr. 591].) Teresa's claim contemplates both that she was possessed of a property right and that she was improperly deprived thereof.
 [4a] We shall consider first the nature of Teresa's property right. Conceding the community nature of the pension, it follows that the community possessed only such an interest therein as August's employment contract provided. The city need perform only in accordance with the contract as the terms thereof are contained pursuant to the charter provisions. That contract provided for payments to August during his lifetime and thereafter for the payment of benefits to August's "widow." Certainly if August had married and divorced several wives during the time he was employed by the city, each former wife would not be entitled to a widow's pension. It is apparent that the contract between the city and the community did not contemplate multiple or divisible pensions, but instead a pension for the member's "widow" only. The only qualification which the charter provision imposes is that which requires the claimant to have been married to the pensioner "at least one year prior to the date of his death." But even this contemplates more than the bare fact that a marriage had taken place at such time, as the one eligible to make claim is further described as the "widow," and the obvious inference is that such marriage must have continued until the member's death.
 On the face of the contract entered into between the community and the city, Teresa was not entitled to assert any personal rights other than those of the community, which were to enforce payments to August and after his death to his widow. (Packer v. Board of Retirement, 35 Cal.2d 212, 216 [217 P.2d 660].)
 This is not to say that upon a division of the community estate she could not have participated therein. Undoubtedly she had an interest which she could have asserted in the payments to August during his lifetime, had she sought to do so. But after August's death the only right remaining was to enforce the city's covenant to make payments to the "widow."
 The nature of a wife's interest in a death benefit pension prior to her husband's demise has before been considered. In *361 Packer v. Board of Retirement, supra, 35 Cal.2d 212, an amendment to a pension statute had eliminated a provision for an automatic pension to widows of certain county employees. In its place the amendment gave an option to the retired employee to receive a lesser pension and thereby insure his widow of a future pension; if, however, he failed to exercise the option he would receive his full pension, and all widow's pension benefits would be lost. The amendment was made effective during the husband's period of employment and during the course of the marriage. He did not exercise his option, and received his full pension during retirement. After his death his widow sought to compel the payment of a pension to her. The court considered and summarized the prevailing law as follows at page 216: "... the cases have not treated provisions for pensions to widows of public employees as separate, vested rights. Rather, a widow's interest, prior to her husband's death, has been considered to be merely a part of the husband's pension benefits and as such subject to being wholly eliminated, provided, of course, that the total change in the husband's pension rights does not exceed the permissible bounds of a modification. It may be conceded that the husband's pension rights derived from his employment during marriage are community property, but this does not furnish any basis for the claim that the widow has a separate, vested right to a pension that is different from her community interest in her husband's pension rights."
 [5] The rule that a wife's interest in a widow's pension may never vest in her in the absence of the happening of the contingency upon which payment of the widow's pension depends was firmly established before the Packer case. (See Sweesy v. Los Angeles etc. Retirement Board, 17 Cal.2d 356, 362 [110 P.2d 37]; Clarke v. Police etc. Ins. Board, 123 Cal. 24 [55 P. 576]; Jordan v. Retirement Board, 35 Cal.App.2d 653 [96 P.2d 973].) Its basis is that to vest interests not subject to control by the employee would impose such inflexibility upon public employment that the purpose of providing for retirement would be defeated. Such purpose is said to be to induce competent persons to enter and remain in public service. (Allen v. City of Long Beach, 45 Cal.2d 128, 131 [287 P.2d 765]; Kern v. City of Long Beach, 29 Cal.2d 848, 851-853, 855, 856 [179 P.2d 799]; French v. French, supra, 17 Cal.2d 775, 777.) Moreover, there is a public policy inherent in the right of a governmental body to make reasonable modifications and changes to a retirement system, which policy *362 would be defeated by the vesting of rights in someone other than the employee. (Kern v. City of Long Beach, supra, 29 Cal.2d 848.) This court stated in the Kern case at pages 854 and 855: "The rule permitting modification of pensions is a necessary one since pension systems must be kept flexible to permit adjustments in accord with changing conditions and at the same time maintain the integrity of the system and carry out its beneficient policy."
 [4b] No reason is suggested why we should depart from the foregoing decisions to the effect that a wife of a public employee acquires no vested interest in a pension until it becomes payable to her. On the other hand, to vest such an interest prior thereto "would remove a considerable amount of the flexibility necessary for operation of pension systems, because it would mean that provisions benefiting any third person would be frozen into the law with respect to all employees then in service and that these interests could not be removed regardless of the consent of the employee and regardless of whether the employee was given other pension benefits which might be of greater value to him than the one sought to be eliminated." (Packer v. Board of Retirement, supra, 35 Cal.2d 212, 217.)
 It is true that in the Packer case the court had before it a change in the applicable statute which resulted in the elimination of the widow's pension, whereas in the instant case Teresa complains only of conduct by August resulting in the claimed detriment. But the cases are not distinguishable in principle. In Packer it was, in the final analysis, the husband's failure to exercise his option which made it impossible for his wife to eventually become vested of a pension. In the instant case it was August's divorce action which prevented Teresa from becoming vested of her pension. In each instance it was what might be termed ex parte action on the part of the husband which resulted in the claimed detriment. Yet it was held in the Packer case that the deprivation of the widow's pension was not an unconstitutional impairment of any rights of which she was vested. Similarly in the instant case August deprived Teresa of no vested right when he divorced her and thus prevented the happening of the necessary contingency that she become his widow before being entitled to the pension provided therefor.
 Claim is made herein that by analogy to a wife's right to share in the proceeds of life insurance paid by premiums from community funds without her consent (see Sieroty v. Silver, *363 58 Cal.2d 799 [26 Cal.Rptr. 635, 376 P.2d 563]), she likewise is entitled to share in a pension which has been earned by community effort.
 In the case of insurance any change in the beneficiary away from the wife without her consent, and without a valuable consideration other than substitution of beneficiaries, is voidable in its entirety by her during her husband's lifetime. (Sieroty v. Silver, supra, 58 Cal.2d 799, 803; Tyre v. Aetna Life Ins. Co., 54 Cal.2d 399, 404 [6 Cal.Rptr. 13, 353 P.2d 725]; Britton v. Hammell, 4 Cal.2d 690, 692 [52 P.2d 221].) This result naturally follows from the right of the wife to give or withhold her consent to any gift of community personal property without a valuable consideration. (Civ. Code,  172.) Even after her husband's death a wife is able to recover half of the proceeds of such policies although she is not a named beneficiary. (Grimm v. Grimm, 26 Cal.2d 173, 175 [157 P.2d 841]; Blethen v. Pacific Mut. Life Ins. Co., 198 Cal. 91, 101 [243 P. 431]; New York Life Ins. Co. v. Bank of Italy, 60 Cal.App. 602, 607 [214 P. 61].) Such latter cases recognize that the designation of the beneficiary is testamentary in character, and section 201 of the Probate Code gives the husband testamentary disposition over one-half of the community property. Thus the wife may still exercise her power to void the gift, but it is now limited to the one-half not validated by the husband's testamentary gift. (See Tyre v. Aetna Life Ins. Co., supra, 54 Cal.2d 399, 404-405.)
 The vested interest which the wife may protect by her collateral control thus precludes an involuntary deprivation thereof in the case of the community interest in insurance on the husband's life. But the acquisition by a wife of a vested interest in her husband's public employment contract might defeat the public purpose in providing a retirement plan for public employees. The distinction lies in the nature of the control which the law permits the husband and wife to independently, lawfully exercise regardless of the community nature of the pension right, and for policy reasons it is deemed necessary that the husband-employee alone exercise control unhampered by vested interests in any third party, including his community partner.
 There remains the question of whether Olive is entitled to recover interest against the city upon unpaid pension payments which accrued prior to the date of entry of judgment. It is contended by the city (1) that there is no statutory authority for the recovery of such interest; (2) that it was *364 improper for the trial court to permit Olive to amend her complaint by adding a specific prayer for interest; and (3) that in any event such interest could not be awarded, since the claim for unpaid pension payments, filed with the city prior to the commencement of this action, did not specifically request interest in addition to the pension amounts.
 [6] It is well settled "in the absence of special statutory authorization, interest cannot be recovered against the state or a municipality." (Los Angeles Dredging Co. v. City of Long Beach, 210 Cal. 348, 362 [291 P. 839, 71 A.L.R. 161]; Blum v. City & County of San Francisco, 200 Cal.App.2d 639, 643 [19 Cal.Rptr. 574].) But, it is argued, section 3287 of the Civil Code authorizes the payment of interest in the instant case.
 Section 3287 provides as follows: "Every person who is entitled to recover damages certain, or capable of being made certain by calculation, and the right to recover which is vested in him upon a particular day, is entitled also to recover interest thereon from that day. ... This section is applicable to recovery of damages and interest from any such debtor, including the State or any county, city, city and county, municipal corporation, public district, public agency, or any political subdivision of the State." (As amended Stats. 1955, ch. 1477, p. 2689,  1; Stats. 1959, ch. 1735, p. 4186,  1.) In 1955 the section was made applicable to any "political subdivision of the State," while the 1959 amendment thereto added in part, cities, municipal corporations, and public agencies to those governmental bodies which were susceptible to the provisions of the statute.
 In 1958 in Abbott v. City of Los Angeles, 50 Cal.2d 438 [326 P.2d 484], this court considered the question of whether section 3287, as amended in 1955, authorized the recovery of prejudgment interest on unpaid pension benefits. We concluded that it did not; however, the rationale underlying our decision was that a municipal corporation was not a "political subdivision of the State," within the meaning of the 1955 amendment. (50 Cal.2d at pp. 467-468.) As indicated, section 3287 was amended in 1959 to thereafter expressly include cities and municipal corporations within its scope.
 [7a] In support of its first contention the city argues that the interest provisions of section 3287 do not apply to the instant case, since the pension benefits herein constitute obligations payable out of a public retirement fund. In support of this position, it cites the companion cases of Jorgensen v. *365 Cranston, 211 Cal.App.2d 292 [27 Cal.Rptr. 297], and McWilliams v. Cranston, 211 Cal.App.2d 852 [27 Cal.Rptr. 303], wherein claims for interest were rejected. Those decisions are, however, distinguishable.
 While the instant action was brought to recover damages for breach of contract and to establish rights thereunder, the actions of Jorgensen and McWilliams constituted proceedings in mandamus to compel the defendant therein, in accordance with an amendment to the Government Code, to issue a warrant in payment of installments due on a death benefit pension from the judges' retirement fund. The refusal to award interest was predicated upon the rule that the recovery of interest is improper in a special proceeding to compel the performance of a duty especially enjoined by law. (Sheehan v. Board of Police Comrs., 188 Cal. 525, 533 [206 P. 70].)
 [8] Moreover the judges' retirement fund is a special trust fund and as such may not fall within the meaning of section 3287 (see Jorgensen v. Cranston, supra, 211 Cal.App.2d 292, 301), whereas it is well established that liability for pensions such as the instant one is not limited to any particular fund, but rather is a general obligation imposed by law upon the city. (England v. City of Long Beach, 27 Cal.2d 343, 347 [163 P.2d 865]; Eaton v. City of Los Angeles, supra, 201 Cal.App.2d 326, 332-333.) [7b] Thus it follows that the city in the instant case may not bring itself within the rationale of the Jorgensen and McWilliams cases for purposes of defeating the claim for interest.
 The city further urges that the recovery of interest herein is governed by section 3302 of the Civil Code and not section 3287 thereof. Section 3302 provides that: "The detriment caused by the breach of an obligation to pay money only, is deemed to be the amount due by the terms of the obligation, with interest thereon." The city would equate the "obligation" mentioned in section 3302 with the judgment herein, and contends that interest cannot be recovered for any period prior to the date of entry of the judgment.
 Sections 3287 and 3302 of the Civil Code are not mutually exclusive and should be construed together, thus subjecting the city to liability for prejudgment interest on past due pension installments if they constitute an "obligation." Both sections fall within title 2 of division 4 of the Civil Code. The term "damages" as used in chapter I thereof (wherein *366  3287 appears and which is entitled "Damages in General") and in chapter II (wherein  3302 is found and which is entitled "Measure of Damages") is defined in section 3281 to mean recovery for the unlawful act or omission of another which causes detriment and which is compensable in money. Clearly the detriment caused by the wrongful withholding of past due pension payments falls within the definition of damages, and as clearly the past due payments represent obligations on which interest will run.
 [9] It is also contended in connection with the claim of a lack of statutory authorization for interest that the city fell within the exception of section 3287 since it was "prevented by law ... from paying the debt" to Olive until after the commencement of this action. The city thus contends that, until there had been a final determination in other proceedings that the 1925 amendment to the city charter was unconstitutional in part, it was prevented by law from paying her claim. The portion deemed unconstitutional was the aforementioned provisions which changed the eligibility requirement that a widow be married to a pensioner for at least one year prior to his retirement instead of one year prior to his death.
 The uncertainty which existed as to the constitutionality of the charter provision was an uncertainty as to law--not fact. [10] Ignorance of the law will normally not serve as a defense to an action, including an action for interest. (See Perkins v. Benguet Consol. Mine Co., 55 Cal.App.2d 720, 769 [132 P.2d 70].) It should further be noted that this court's opinion in 1958 in Abbott v. City of Los Angeles, supra, 50 Cal.2d 438, raised a substantial doubt as to the validity of the charter amendment in applications such as the instant one.
 [11] Examining next the city's contention that it was improper for the trial court to permit an amendment to the pleadings adding a specific prayer for the allowance of interest, it should suffice to state that interest may be awarded in a contested action even though there is no specific prayer therefor. (Perry v. Magneson, 207 Cal. 617, 622 [279 P. 650]; Deaux v. Trinidad Bean & Elevator Co., 8 Cal.App.2d 149, 152 [47 P.2d 535]; Sears, Roebuck & Co. v. Blade, 139 Cal.App.2d 580 [294 P.2d 140].)
 [12] The city's assertion that the recovery of interest herein is barred by the failure of the plaintiffs to file a claim with the city for such interest is equally without merit. Because the city rejected the claimants' applications for pension *367 benefits any further demand for interest became a futile act not required by law. (See Perkins v. Benguet Consol. Mine Co., supra, 55 Cal.App.2d 720, 765; Dillon v. Board of Pension Comrs., 18 Cal.2d 427 [116 P.2d 37, 136 A.L.R. 800]; Steen v. Board of Civil Service Comrs., 26 Cal.2d 716 [160 P.2d 816].)
 The judgment is affirmed.
 Gibson, C. J., Traynor, J., Schauer, J., McComb, J., Peters, J., and Tobriner J., concurred.
