1985. California Code of Civil Procedure (a) The process by which the attendance of a witness is required is the subpoena. It is a writ or order directed to a person and requiring the person's attendance at a particular time and place to testify as a witness. It may also require a witness to bring any books, documents, or other things under the witness's control which the witness is bound by law to produce in evidence. * * * *
(b) A copy of an affidavit shall be served with a subpoena duces tecum issued before trial, showing good cause for the production of the matters and things described in the subpoena, specifying the exact matters or things desired to be produced, setting forth in full detail the materiality thereof to the issues involved in the case, and stating that the witness has the desired matters or things in his or her possession or under his or her control.
Section 1987.1. (a) If a subpoena requires the attendance of a witness or the production of books, documents, or other things before a court, or at the trial of an issue therein, or at the taking of a deposition, the court, upon motion reasonably made by any person described in subdivision (b), or upon the court's own motion after giving counsel notice and an opportunity to be heard, may make an order quashing the subpoena entirely, modifying it, or directing compliance with it upon those terms or conditions as the court shall declare, including protective orders.
In addition, the court may make any other order as may be appropriate to protect the person from unreasonable or oppressive demands, including unreasonable violations of the right of privacy of the person. (b) The following persons may make a motion pursuant to subdivision (a): (1) A party. (2) A witness. * * *