
48 Cal.4th 330 (2010)
226 P.3d 348
THE PEOPLE, Plaintiff and Respondent,
v.
ANDREW NELSON PICKLESIMER, Defendant and Appellant.
No. S165680.
Supreme Court of California.
March 15, 2010.
*335 Law Offices of Dane A. Cameron and Dane A. Cameron for Defendant and Appellant.
Edmund G. Brown, Jr., Attorney General, Dane R. Gillette, Chief Assistant Attorney General, Michael P. Farrell, Assistant Attorney General, John G. McLean, Stephen G. Herndon, Janet E. Neeley and Darren K. Indermill, Deputy Attorneys General, for Plaintiff and Respondent.

OPINION
WERDEGAR, J.
In People v. Hofsheier (2006) 37 Cal.4th 1185, 1207 [39 Cal.Rptr.3d 821, 129 P.3d 29] (Hofsheier), we concluded imposition of mandatory lifetime sex offender registration on defendants convicted of violations of Penal Code section 288a, subdivision (b)(1)[1] for voluntary oral copulation with a 16- or 17-year-old minor violated the state and federal equal protection clauses. Our decision resulted in the creation of a class of people, those convicted of violating section 288a, subdivision (b)(1) on or before the date of our decision, who potentially might be entitled to relief from mandatory lifetime registration but for whom the precise procedural method of asserting such a claim for relief was uncertain. We resolve that uncertainty here.
We conclude that for those like defendant Andrew Nelson Picklesimer, who are no longer in custody and whose appeals are final, claims for Hofsheier reliefrelief from mandatory lifetime sex offender registration based on equal protectionmust be brought by way of a petition for writ of mandate in the trial court. A freestanding postjudgment motion for Hofsheier relief, such as the one Picklesimer filed, is not cognizable, as the trial court and Court of Appeal correctly concluded.
A court may in its discretion treat such a postjudgment motion as a mislabeled petition for writ of mandate. In this case, however, for us to do so is not appropriate. This is because defendants who assert a claim for Hofsheier relief and establish a right to relief from mandatory sex offender registration may still be subject to discretionary registration under section 290.006, and the record before us does not conclusively establish that Picklesimer is exempt from discretionary registration and thus entitled to relief.
*336 Accordingly, we affirm, without prejudice to Picklesimer's ability to file a petition for writ of mandate in the trial court seeking Hofsheier relief.

FACTUAL AND PROCEDURAL BACKGROUND
In 1993, Picklesimer pleaded guilty to violations of sections 261.5 (sexual intercourse with a minor), 288a, subdivision (b)(1) (oral copulation with a minor), and 289, subdivision (h) (sexual penetration of a minor) and was sentenced to four years four months in prison. As an automatic consequence of the oral copulation and sexual penetration convictions, Picklesimer was required to register as a sex offender. (Former § 290, subd. (a)(2)(A), now § 290, subd. (c).) On appeal, the judgment was affirmed. Picklesimer completed his sentence and was released from custody.
In October 2006, after our decision in Hofsheier, Picklesimer filed a motion in the trial court asking to be removed from the state sex offender registry and relieved from his lifetime registration obligation. At a hearing on the motion, the trial court ruled it lacked jurisdiction, noting Picklesimer had failed to identify any authority that would permit the court to rule on such a freestanding motion. Picklesimer appealed.
The Court of Appeal agreed that the trial court lacked jurisdiction. Accordingly, it concluded Picklesimer was not aggrieved by the trial court's order denying his motion (see § 1237, subd. (b)), the order was therefore unappealable, and the appeal must be dismissed.
We granted review to address the proper treatment of claims for relief under Hofsheier.

DISCUSSION

I. Claims for Hofsheier Relief by Individuals No Longer in Custody Must Be Brought by Way of a Petition for Writ of Mandate

(1) In Hofsheier, supra, 37 Cal.4th 1185, we considered a constitutional challenge to the mandatory sex offender registration requirement imposed for convictions under section 288a, subdivision (b)(1) (oral copulation with a minor) in light of the absence of any similar requirement for convictions under section 261.5 (sexual intercourse with a minor). We concluded that, at least for voluntary oral copulation with a 16- or 17-year-old minor, the registration requirement could not withstand rational basis review and, *337 accordingly, was a violation of equal protection. (Hofsheier, at pp. 1200-1207.) Following our decision in Hofsheier, the Department of Justice advised Picklesimer and others of the possibility they could be eligible to have their names removed from the state sex offender registry.
(2) Picklesimer sought relief by filing a motion in the trial court, purportedly as part of People v. Picklesimer (Super. Ct. Trinity County, 1993, No. 92CR065), the People's long-since-final criminal prosecution of him. However, "[t]here is no statutory authority for a trial court to entertain a postjudgment motion that is unrelated to any proceeding then pending before the court. [Citation.] Indeed, a motion is not an independent remedy. It is ancillary to an on-going action and `"implies the pendency of a suit between the parties and is confined to incidental matters in the progress of the cause. As the rule is sometimes expressed, a motion relates to some question collateral to the main object of the action and is connected with, and dependent on, the principal remedy."' [Citation.] In most cases, after the judgment has become final, there is nothing pending to which a motion may attach." (Lewis v. Superior Court (2008) 169 Cal.App.4th 70, 76-77 [86 Cal.Rptr.3d 565].)
(3) Although exceptions to the rule precluding postjudgment motions exist,[2] Picklesimer does not demonstrate persuasively that any apply. Relying on one of our more ancient pronouncements, he argues that once the Court of Appeal issued its remittitur after affirming the original judgment, the trial court's jurisdiction over the case, largely suspended during the pendency of the appeal, resumed. (See People v. Dick (1870) 39 Cal. 102, 103-104.) While this is true, the argument speaks only to the allocation of jurisdiction between trial courts and Courts of Appeal and does not address the core issuethe actual scope of the trial court's postjudgment jurisdiction. Following appellate affirmance of a trial court judgment and issuance of a remittitur, "the trial court is revested with jurisdiction of the case, but only to carry out the judgment as ordered by the appellate court." (People v. Dutra (2006) 145 Cal.App.4th 1359, 1366 [52 Cal.Rptr.3d 528]; see § 1265, subd. (a) [following receipt of remittitur, the trial court has jurisdiction to issue "all orders necessary to carry the judgment into effect"].) As both parties recognize, Picklesimer's registration requirements and placement in the state sex *338 offender registry are not part of the judgment in his case, but rather collateral consequences of that judgment. Accordingly, the trial court's jurisdiction to issue orders carrying out the judgment did not grant it authority to act on a motion seeking to modify an obligation that was not any part of the judgment.[3]
Nor is Picklesimer's obligation to register part of an unauthorized sentence, which the trial court would have had jurisdiction to correct at any time. (See In re Sheena K. (2007) 40 Cal.4th 875, 882 & fn. 3, 887 [55 Cal.Rptr.3d 716, 153 P.3d 282]; People v. Scott (1994) 9 Cal.4th 331, 354 [36 Cal.Rptr.2d 627, 885 P.2d 1040]; In re Harris (1993) 5 Cal.4th 813, 840 [21 Cal.Rptr.2d 373, 855 P.2d 391] ["`Fundamental jurisdictional defects [i.e., acts in excess of jurisdiction], like constitutional defects, do not become irremediable when a judgment of conviction becomes final, even after affirmance on appeal.'"].) Rather, the obligation is a separate consequence of Picklesimer's conviction automatically imposed as a matter of law.
(4) Finally, we reject Picklesimer's argument that Code of Civil Procedure section 187 creates jurisdiction to address his motion. (See People v. Hyde, supra, 49 Cal.App.3d 97 [relying on Code Civ. Proc., § 187 as authority for a trial court to hear a postjudgment motion for presentencing custody credits].) Section 187 of the Code of Civil Procedure provides: "When jurisdiction is, by the Constitution or this Code, or by any other statute, conferred on a Court or judicial officer, all the means necessary to carry it into effect are also given; and in the exercise of this jurisdiction, if the course of proceeding be not specifically pointed out by this Code or the statute, any suitable process or mode of proceeding may be adopted which may appear most conformable to the spirit of this Code." The section does not speak to jurisdiction; it does not create jurisdiction; rather, the existence of jurisdiction is the premise for its application. Where jurisdiction exists from other sources, Code of Civil Procedure section 187 grants courts authority to exercise any of their various powers as may be necessary to carry out that jurisdiction. To the extent jurisdiction to hear Picklesimer's motion is otherwise lacking, Code of Civil Procedure section 187 affords Picklesimer no comfort here.[4]
*339 (5) That a postjudgment motion is unavailable does not mean dismissal is mandated. As the People concede, every right must have a remedy. (See People v. Hyde, supra, 49 Cal.App.3d at p. 101 ["[A] right but no expeditious and adequate remedy. . . . is an unconscionable situation which a court of justice cannot tolerate."].)
(6) For a defendant still in actual or constructive custody, a petition for writ of habeas corpus in the trial court is the preferred method by which to challenge circumstances or actions declared unconstitutional after the defendant's conviction became final. (See People v. Fuhrman (1997) 16 Cal.4th 930, 942 [67 Cal.Rptr.2d 1, 941 P.2d 1189]; People v. Superior Court (Romero) (1996) 13 Cal.4th 497, 530, fn. 13 [53 Cal.Rptr.2d 789, 917 P.2d 628]; People v. Tenorio (1970) 3 Cal.3d 89, 95, fn. 2 [89 Cal.Rptr. 249, 473 P.2d 993].) But once a defendant has been released and is no longer subject to parole or probation, he or she is no longer in constructive custody and this avenue is foreclosed. (People v. Villa (2009) 45 Cal.4th 1063, 1069-1070 [90 Cal.Rptr.3d 344, 202 P.3d 427].) "[C]ollateral consequences of a criminal convictioneven those that can later form the basis of a new criminal convictiondo not of themselves constitute constructive custody." (Id. at p. 1070.) Thus, a party no longer in constructive custody may not challenge his or her obligation to register as a sex offender by way of a petition for writ of habeas corpus. (In re Stier (2007) 152 Cal.App.4th 63, 81-83 [61 Cal.Rptr.3d 181].)
(7) For out-of-custody defendants such as Picklesimer, we agree with the Court of Appeal's analysis of the problem in Lewis v. Superior Court, supra, 169 Cal.App.4th 70, now seconded by the People: the appropriate vehicle for seeking Hofsheier relief is a petition for writ of mandate filed in the trial court. (Lewis, at p. 77; see also In re Stier, supra, 152 Cal.App.4th at pp. 83-84.) Unlike a petition for writ of habeas corpus, a petition for writ of mandate does not require ongoing custody; unlike a postjudgment motion, it is an independent proceeding that vests the trial court with jurisdiction to act. (See Code Civ. Proc., § 1085; Lewis, at p. 77.)
(8) Code of Civil Procedure section 1085, providing for writs of mandate, is available to compel public agencies to perform acts required by law. (Santa Clara County Counsel Attys. Assn. v. Woodside (1994) 7 Cal.4th 525, 539 *340 [28 Cal.Rptr.2d 617, 869 P.2d 1142].) To obtain relief, a petitioner must demonstrate (1) no "plain, speedy, and adequate" alternative remedy exists (Code Civ. Proc., § 1086); (2) "`a clear, present . . . ministerial duty on the part of the respondent'"; and (3) a correlative "`clear, present and beneficial right in the petitioner to the performance of that duty.'" (Santa Clara County Counsel Attys. Assn., at pp. 539-540; see Code Civ. Proc., §§ 1085-1086.) A ministerial duty is an obligation to perform a specific act in a manner prescribed by law whenever a given state of facts exists, without regard to any personal judgment as to the propriety of the act. (Kavanaugh v. West Sonoma County Union High School Dist. (2003) 29 Cal.4th 911, 916 [129 Cal.Rptr.2d 811, 62 P.3d 54].)
(9) Picklesimer and other noncustodial parties seeking Hofsheier relief have no available alternative remedy. Upon the filing of a verified petition for writ of mandate (see Code Civ. Proc., § 1086), a trial court has jurisdiction to resolve any legal or factual issues, via an evidentiary hearing if need be (Cal. Rules of Court, rules 3.1103, 3.1306). Placement in, or removal of, a person from the state sex offender registry is a ministerial act, contingent only on whether the person has suffered a conviction that lawfully mandates registration (§ 290, subd. (c)) or has been the subject of a court's discretionary order to require registration (§ 290.006). If a party seeking Hofsheier relief can establish he or she no longer should be required to register, the trial court may issue a writ directing the Department of Justice to remove the petitioner from the state sex offender registry. Accordingly, we hold a petition for writ of mandate filed in the trial court is the proper way for a postcustodial party to seek Hofsheier relief.[5]
(10) Picklesimer misfiled his request for Hofsheier relief as a postjudgment motion. However, "[t]he label given a petition, action or other pleading is not determinative; rather, the true nature of a petition or cause of action is based on the facts alleged and remedy sought in that pleading." (Escamilla v. Department of Corrections & Rehabilitation (2006) 141 Cal.App.4th 498, 511 [46 Cal.Rptr.3d 408]; accord, People v. Villa, supra, 45 Cal.4th at pp. 1067-1068.) Assuming the pleading that has been filed meets or can be amended to meet the prerequisites for a petition for writ of mandate, a court in its discretion may treat a motion or a petition for a different writ as a mislabeled petition for writ of mandate. (Lewis v. Superior Court, supra, 169 Cal.App.4th at p. 77 [postjudgment motion]; Escamilla, at pp. 511-512 *341 [petition for writ of habeas corpus]; cf. In re Stier, supra, 152 Cal.App.4th at pp. 83-84 [recognizing the general principle, but declining to exercise its discretion to convert a petition for writ of habeas corpus to a petition for writ of mandate and decide it on the merits].)
Picklesimer asks that we exercise our discretion to treat his motion as a petition for writ of mandate and decide it in the first instance, as in Lewis v. Superior Court, supra, 169 Cal.App.4th 70. The People ask that we decline to do so and allow the merits to be addressed in the first instance in the trial court, as in In re Stier, supra, 152 Cal.App.4th 63. Which course is proper depends in large part on whether the appellate record is sufficient to determine that all potential factual issues are undisputed, as in Lewis, or whether it is incomplete and precludes such a determination, as in Stier. In turn, whether any potential factual issues exist depends on whether Picklesimer has established he is entitled to be freed from all registration requirements as a matter of law. We turn to that question.

II. Section 290.006 Applies Retroactively to Parties Seeking Hofsheier Relief; Accordingly, Picklesimer Has Not Established a Right to Be Free from Registration as a Matter of Law

Picklesimer's mandatory registration rests on two convictions, one under section 288a, subdivision (b)(1) (oral copulation with a minor) and the other under section 289, subdivision (h) (sexual penetration of a minor). The first of these is the precise violation we addressed in Hofsheier, supra, 37 Cal.4th 1185. Picklesimer's victim was 17 years old, and the People do not contest that the oral copulation was "voluntary" in the limited sense we used that term in Hofsheier;[6] accordingly, they concede this conviction cannot support mandatory registration. While we did not address section 289, subdivision (h) in Hofsheier, the People similarly concede Hofsheier's principles are equally applicable to that section and it too cannot be a basis for mandatory registration here. (See People v. Ranscht (2009) 173 Cal.App.4th 1369 [93 Cal.Rptr.3d 800] [holding mandatory registration based on a conviction for voluntary sexual penetration (§ 289, subd. (h)) violates equal protection].) *342 Thus, we assume without deciding that Picklesimer is not subject to lifetime registration under the mandatory provisions of the Sex Offender Registration Act (the Act) (§§ 290-290.023).
However, the People contend Picklesimer still is not entitled to relief as a matter of right; rather, they argue, the trial court must first determine whether he should be subject to discretionary lifetime registration. (§ 290.006.)[7] In contrast, Picklesimer insists that relief is mandatory because section 290.006 cannot be applied to him. We consider whether Picklesimer may be subject to discretionary lifetime registration.
(11) In Hofsheier itself, we limited relief to a remand for application of section 290.006 (then codified as former § 290, subd. (a)(2)(E)). (Hofsheier, supra, 37 Cal.4th at pp. 1208-1209.) That is, we concluded the consequence of the equal protection violation was not that a defendant convicted under section 288a, subdivision (b)(1) (oral copulation with a minor) had been placed in the state sex offender registry when otherwise he would have been excluded, but that he had been placed in the state sex offender registry automatically when otherwise his placement would have been a matter of discretion under former section 290, subdivision (a)(2)(E) (now § 290.006). The remedy we crafted, remand for a discretionary determination whether Hofsheier should be required to register, was tailored to address this harm. Picklesimer's various arguments for why section 290.006 cannot be applied to him do not persuade us a different result is required here.
(12) Picklesimer argues section 290.006 cannot be applied retroactively to him, as it was originally adopted in 1994, after he was convicted. (See former § 290, subd. (a)(2)(E), enacted by Stats. 1994, ch. 867, § 2.7, pp. 4389-4390; People v. Olea (1997) 59 Cal.App.4th 1289, 1292, fn. 1 [69 Cal.Rptr.2d 722].) "New statutes are presumed to operate only prospectively absent some clear indication that the Legislature intended otherwise." (Elsner v. Uveges (2004) 34 Cal.4th 915, 936 [22 Cal.Rptr.3d 530, 102 P.3d 915].) Here, there is just such a pellucid declaration of legislative intent: "The registration provisions of the Act are applicable to every person described in the Act, without regard to when his or her crime or crimes were committed or his or her duty to register pursuant to the Act arose, and to every offense described in the Act, regardless of when it was committed." (§ 290.023.)
Conceding this statutory language, Picklesimer nevertheless argues the Legislature never intended section 290.006, which by its terms requires *343 contemporaneous findings, to extend retroactively to convictions entered before January 1, 1995, the statute's effective date. In effect, Picklesimer argues that those convicted of section 261.5 (sexual intercourse with a minor) violations and sentenced before January 1, 1995, are not subject to discretionary registration, because former section 290, subdivision (a)(2)(E) (now § 290.006) by its terms established only a forward-looking requirementthat trial courts at conviction or sentencing consider discretionary registration. Accordingly, the consequence of the equal protection violation for those defendants, like Picklesimer, convicted of section 288a, subdivision (b)(1) (oral copulation with a minor) and sentenced before January 1, 1995, is that they are placed on the sex offender rolls when they would otherwise have been free of both mandatory and discretionary registration.
(13) We disagree. The Legislature's clear intent is for all provisions of the Act, including section 290.006, to apply going forward. We determined in Hofsheier, supra, 37 Cal.4th 1185, and reiterate today, that in cases where mandatory sex offender registration has been shown to violate equal protection, the procedure that most closely matches the legislative intent is not automatic removal of a sex offender from the state sex offender registry, but an after-the-fact discretionary determination whether removal is appropriate.[8] To permit trial courts at such a relief hearing to consider discretionary registration only if the underlying conviction arose on or after January 1, 1995, would contravene the Legislature's implicit intent in adopting the Act. (See § 290.023 [dates of offense and initial duty to register are immaterial for purposes of applying the Act]; cf. People v. Castellanos (1999) 21 Cal.4th 785 [88 Cal.Rptr.2d 346, 982 P.2d 211] [upholding as constitutional the Legislature's decision to extend former § 290, subd. (a)(2)(E), now § 290.006, to offenses committed before Jan. 1, 1995].) Accordingly, in crafting an equal protection remedy, we see no reason to distinguish between Hofsheier relief proceedings involving pre-1995 and post-1995 convictions. (See People v. Garcia, supra, 161 Cal.App.4th at p. 486 [§ 290.006 may be constitutionally applied to a defendant seeking Hofsheier relief, even though it was not in existence when the defendant was originally sentenced].)
(14) In the alternative, Picklesimer argues application of section 290.006 is unlawful because it permits imposition of heightened punishment based on findings of fact by a trial court rather than a jury, in violation of Apprendi v. New Jersey (2000) 530 U.S. 466 [147 L.Ed.2d 435, 120 S.Ct. 2348] and its progeny. As we have explained, "sex offender registration is not considered a *344 form of punishment under the state or federal Constitution [citations] . . . ." (Hofsheier, supra, 37 Cal.4th at p. 1197; see also Smith v. Doe (2003) 538 U.S. 84, 105-106 [155 L.Ed.2d 164, 123 S.Ct. 1140] [sex offender registration is not punishment for purposes of the ex post facto clause].) Accordingly, Apprendi's requirement that "[o]ther than the fact of a prior conviction, any fact that increases the penalty for a crime beyond the prescribed statutory maximum must be submitted to a jury, and proved beyond a reasonable doubt" (Apprendi, at p. 490) has no application here. (See People v. Presley (2007) 156 Cal.App.4th 1027, 1033-1035 [67 Cal.Rptr.3d 826] [Apprendi does not apply to the discretionary determination whether to require sex offender registration]; People v. Garcia, supra, 161 Cal.App.4th at p. 486 [Apprendi does not apply to the determination whether to deny Hofsheier relief on the ground discretionary registration should still be imposed].)
Picklesimer acknowledges our previous conclusions that registration is not punishment, but argues that the sex offender residency restrictions of the Sexual Predator Punishment and Control Act: Jessica's Law (§ 3003.5, subd. (b), added by Prop. 83, as approved by voters, Gen. Elec. (Nov. 7, 2006)) are punishment, and thus that the facts required to impose those restrictionsthe facts supporting continued sex offender statusmust now be found beyond a reasonable doubt by a jury pursuant to Apprendi v. New Jersey, supra, 530 U.S. 466, and its progeny. Picklesimer cannot show a potential Apprendi violation on this basis. If Proposition 83's restrictions do not amount to punishment for his original crimes, there is no Apprendi problem and no right to a jury trial. Conversely, if Proposition 83's restrictions were to be considered punishment for his original offenses (but see In re E.J. (2010) 47 Cal.4th 1258, 1271-1280 [104 Cal.Rptr.3d 165, 223 P.3d 31]), they could not under the state and federal ex post facto clauses be constitutionally applied to Picklesimer, whose crimes all long predate the approval of Proposition 83. (See U.S. Const., art. I, § 10, cl. 1; Cal. Const., art. I, § 9; People v. Grant (1999) 20 Cal.4th 150, 158 [83 Cal.Rptr.2d 295, 973 P.2d 72].) In either event, there is no constitutional bar to having a judge exercise his or her discretion to determine whether Picklesimer should continue to be subject to registration.
(15) Picklesimer also contends he cannot be subjected to a discretionary determination on whether he should continue to be required to register without first being permitted the opportunity to withdraw his plea. But he concedes he was aware at the time he entered his plea that sex offender registration was a mandatory, automatic consequence of the plea; he cannot complain now that he is being afforded at least the possibility of being spared that consequence. Indeed, as we explained in People v. McClellan (1993) 6 Cal.4th 367, 378 [24 Cal.Rptr.2d 739, 862 P.2d 739], even had Picklesimer not been aware of the registration consequence, he would not be entitled to withdraw his plea absent a showing that he would not have pleaded guilty but *345 for the court's omission. Where, as here, there was no misadvisement and no breach of any plea term, there certainly is no basis for a plea withdrawal. (See People v. Walker (1991) 54 Cal.3d 1013, 1022-1027 [1 Cal.Rptr.2d 902, 819 P.2d 861].)
(16) Next, Picklesimer argues section 290.006 was intended to apply only to "nonsexual" offenses, such as stalking or burglary, that may have been committed to gratify sexual impulses, not to inherently sexual offenses the Legislature chose to exempt from mandatory registration. Notably, however, the language of the statute contains no such limitation; instead, it requires registration following conviction "for any offense not included specifically in subdivision (c) of Section 290" (the provision listing those convictions that give rise to mandatory registration), provided certain findings are made. (§ 290.006.) The statutory scheme thus creates two categories of crimes: those listed in section 290, subdivision (c) (to which a registration requirement attaches automatically) and all others (for which registration is contingent on the trial court making specific additional findings under § 290.006). Picklesimer essentially posits three categories of crimes: those (uniformly sexual in nature) for which registration is mandatory, those (uniformly nonsexual in nature) for which registration is permitted, and those (again, uniformly sexual in nature) for which registration is forbidden. As the statutory scheme nowhere identifies what crimes might fall in this supposed third category, nor offers any judicial warrant for creating such a category, we decline to do so.
Finally, Picklesimer argues that even if section 290.006 applies to him, no facts exist that would support the trial court's exercise of discretion to retain him in the state sex offender registry. (See Lewis v. Superior Court, supra, 169 Cal.App.4th at pp. 78-79 [granting Hofsheier relief on appeal, because there was no evidence in the record to support a discretionary registration requirement].) Accordingly, he argues, we may still follow the Lewis course of treating his motion as a petition for writ of mandate and issuing a writ directing the trial court to grant him relief.
The issue, however, is contested, and unlike in Lewis v. Superior Court, supra, 169 Cal.App.4th 70, the record before us is incomplete; no part of the original proceedings is included in the record on appeal. We thus cannot determine whether this is a case in which there is "no basis for the exercise of discretion" because "the existing facts unequivocally require one particular action." (Id. at p. 77.) We therefore follow the course of the Court of Appeal in In re Stier, supra, 152 Cal.App.4th 63, and decline to exercise our discretion to convert Picklesimer's motion to a petition for writ of mandate and decide it on the merits.


*346 DISPOSITION
For the foregoing reasons, we affirm the judgment of the Court of Appeal, without prejudice to Picklesimer's opportunity to file an original petition for writ of mandate in the trial court seeking whatever relief he may be entitled to under People v. Hofsheier, supra, 37 Cal.4th 1185.
George, C. J., Kennard, J., Baxter, J., Chin, J., Moreno, J., and Corrigan, J., concurred.
NOTES
[1]  All further unlabeled statutory references are to the Penal Code.
[2]  These exceptions generally arise in instances where the Legislature has expressly authorized such a motion. (See, e.g., § 17, subd. (b)(3) [motion to reduce a "wobbler" to a misdemeanor]; § 1016.5, subd. (b) [motion to vacate judgment and withdraw a plea based on the immigration consequences of the plea]; § 1203.4 [motion by probationer to vacate plea and dismiss charges]; § 1473.6 [motion to vacate judgment based on newly discovered evidence of fraud].)
[3]  This point distinguishes People v. Hyde (1975) 49 Cal.App.3d 97 [122 Cal.Rptr. 297], relied on by Picklesimer. In Hyde, the in-custody defendant filed a postjudgment motion asserting his entitlement to additional presentence custody credits disputed by the Adult Authority. The underlying judgment sentenced the defendant to state prison "`for the term prescribed by law'" (id. at p. 101), and the defendant sought to have the court clarify that portion of its judgment. Whether or not Hyde was correct under the law as it then stood in the area it addressed (a motion to clarify prison custody credits)a point we do not decideit has no bearing here.
[4]  Without analysis of the procedural questions we resolve here, several Courts of Appeal have addressed on the merits appeals of freestanding postjudgment motions seeking Hofsheier relief. (See People v. Luansing (2009) 176 Cal.App.4th 676 [97 Cal.Rptr.3d 836]; People v. Hernandez (2008) 166 Cal.App.4th 641 [83 Cal.Rptr.3d 29]; People v. Manchel (2008) 163 Cal.App.4th 1108 [78 Cal.Rptr.3d 194]; People v. Garcia (2008) 161 Cal.App.4th 475 [74 Cal.Rptr.3d 681].) To the extent these cases may be read as endorsing a postjudgment motion as an appropriate means of seeking Hofsheier relief for noncustodial defendants, we disapprove them as inconsistent with our analysis.
[5]  While the Department of Justice, as the entity responsible for maintenance of the state sex offender registry, would be the nominal respondent, the People as the real party in interest should receive notice and an opportunity to appear in any writ proceedings as well.
[6]  As we there explained, in Hofsheier we used "the term `voluntary' in a special and restricted sense to indicate both that the minor victim willingly participated in the act and [that] . . . various statutory aggravating circumstances [were absent]: the perpetrator's use of `force, violence, duress, menace or fear of immediate and unlawful bodily injury on the victim or another person' (§ 288a, subd. (c)(2)); the perpetrator's `threatening to retaliate in the future against the victim or any other person' (§ 288a, subd. (c)(3)); and the commission of the act while the victim is unconscious (§ 288a, subd. (f)) or intoxicated (§ 288a, subd. (i))." (Hofsheier, supra, 37 Cal.4th at p. 1193, fn. 2.)
[7]  Section 290.006 provides: "Any person ordered by any court to register pursuant to the Act for any offense not included specifically in subdivision (c) of Section 290, shall so register, if the court finds at the time of conviction or sentencing that the person committed the offense as a result of sexual compulsion or for purposes of sexual gratification. The court shall state on the record the reasons for its findings and the reasons for requiring registration."
[8]  It is true section 290.006's language provides for discretionary findings to be made "at the time of conviction or sentencing." However, implicit in our decision in Hofsheier, supra, 37 Cal.4th at pages 1208-1209, was the conclusion that the Legislature did not intend by this language to strip courts of the power to later enter findings in instances where, at the time of conviction or sentencing, any need for findings was obviated by the existence of a then valid mandatory registration requirement.
