Code of Civil Procedure section 1986
(a)
To require attendance before a court, or at the trial of an issue therein, or upon the taking of a deposition in an action or proceeding pending therein, it is obtainable from the clerk of the court in which the action or proceeding is pending.(b)
To require attendance before a commissioner appointed to take testimony by a court of a foreign country, or of the United States, or of any other state in the United States, or before any officer or officers empowered by the laws of the United States to take testimony, it may be obtained from the clerk of the superior court of the county in which the witness is to be examined.(c)
To require attendance out of court, in cases not provided for in subdivision (a), before a judge, justice, or other officer authorized to administer oaths or take testimony in any matter under the laws of this state, it is obtainable from the judge, justice, or other officer before whom the attendance is required.
Source:
Section 1986, https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CCP§ionNum=1986.
(accessed May 4, 2025).