A subpoena is obtainable as follows:
If the subpoena is to require attendance before a court, or at the trial of an issue therein, it is obtainable from the clerk, as of course, upon the application of the party desiring it. If it is obtained to require attendance before a commissioner or other officer upon the taking of a deposition, it must be obtained, as of course, from the clerk of the superior court of the county wherein the attendance is required upon the application of the party requiring it.
Ca. Civ. Proc. Code § 1986