
601 P.2d 929 (1979)
STATE of Utah, Plaintiff and Respondent,
v.
Lorenzo S. HUBBARD, Defendant and Appellant.
No. 15953.
Supreme Court of Utah.
October 17, 1979.
D. Sanford Jorgensen of Mooney, Jorgensen & Nakamura, Salt Lake City, for defendant and appellant.
Robert B. Hansen, Atty. Gen., Salt Lake City, for plaintiff and respondent.
CROCKETT, Chief Justice:
Defendant, Lorenzo S. Hubbard, was convicted by a jury of unlawful distribution for *930 value of a controlled substance,[1] to-wit: heroin. He seeks a reversal on the ground that the trial court erred in refusing to require the State's witness, Henry Salazar, to undergo a psychological examination to determine his competency as a witness. Defendant makes no contention as to the sufficiency of the evidence to justify his conviction, but directs his attack only upon the quality of the evidence against him.
Mr. Salazar, while serving a sentence in the Salt Lake County jail, was approached by the Salt Lake City Police about making a purchase of heroin from the defendant. Mr. Salazar agreed. On February 9, 1978, under the supervision of police officers, preliminaries were taken care of: he was searched, given money, and furnished a car to go make the "buy". He then drove the car to the Westside Hotel, parked, and while the officers waited outside, he went in. Salazar testified that he met the defendant in the hotel lobby, gave him $60 and received a quantity of heroin in return.
Based upon the foregoing, the defendant was charged as set out above. At the pretrial conference, and again at trial, the defendant's counsel made a motion that Mr. Salazar be subjected to a psychiatric examination for the purpose of determining whether he was competent to be a witness. This motion was denied on both occasions.
The statute which relates to defendant's contention that his request for a psychological examination of Mr. Salazar should have been granted is Sec. 78-24-1, U.C.A. 1953. It specifies that to qualify as a witness, a person must have the ability to perceive, and to make known his perceptions to others.[2] To be considered in conjunction therewith is Rule 17 of the Utah Rules of Evidence: "[a] person is disqualified to be a witness if the Judge finds that ... (b) the proposed witness is incapable of understanding the duty of a witness to tell the truth."
The facts upon which defendant relied in support of his motion are that Mr. Salazar had a history of use of drugs dating back about 30 years; that he had a criminal record which began in 1949, which included convictions for armed robbery, burglary, grand theft, theft by deception, possession of narcotics and various parole violations. It was also brought out that he had injected heroin on the morning of the day he made the purchase of heroin from the defendant.
We do not question that if it were made to appear that there is a substantial doubt that a witness is capable of understanding and appreciating the duty to tell the truth, or that he is able to perceive, remember and communicate facts with reasonable accuracy, the trial judge might grant a request for such an examination before permitting him to testify. However, in the very nature of such an inquiry, and the prerogatives which belong in the first instance to the trial judge, and secondly to the jury, of judging the credibility of witnesses, the determination as to whether such an examination should be had must necessarily rest largely within the discretion of the trial judge. In harmony with that proposition is our Rule 8, Utah Rules of Evidence which states in part that:
When the qualification of a person to be a witness, .. . is in issue, the issue is to be determined by the judge, . .
Bearing on the trial court's refusal to order a psychological examination of the witness Salazar are the following observations. It is quite universally accepted that the matter of previous criminal convictions, or instances of untruthfulness, or even of the use of narcotics, do not necessarily disqualify a person from being a witness, but they are matters which, in appropriate circumstances, may be shown as bearing upon the credibility of the witness.[3]
*931 All of the above-mentioned matters, including the prior criminal record of Mr. Salazar, were brought out both at the preliminary hearing and at the trial so that the defendant had whatever advantage it afforded him in discrediting Mr. Salazar's testimony; and similarly the trial court had it to consider in making his ruling. Additionally, from the evidence relating to his activities in connection with the crime, it is apparent that Mr. Salazar was able to converse about and agree upon a plan, to drive the automobile, consummate the transaction and report back to the police. His handwritten report, made immediately after the occurrence, was admitted in evidence indicating Mr. Salazar's ability to perceive, understand and communicate.
From what has been said herein, we are not persuaded that the trial judge abused his discretion in refusing to require the requested psychological examination of Mr. Salazar as a pre-condition to permitting him to testify.
Affirmed.
MAUGHAN, WILKINS and HALL, JJ., concur.
STEWART, J., concurs in result.
NOTES
[1]  58-37-8(1)(a)(ii), U.C.A. 1953, as amended.
[2]  All persons, without exception, otherwise than as specified in this chapter, who, having organs of sense, can perceive, and, perceiving, can make known their perceptions to others, may be witnesses. Neither parties nor other persons who have an interest in the event of an action or proceeding are excluded; nor those who have been convicted of crime; ... although, in every case the credibility of the witness may be drawn in question, ...
[3]  State v. Scott, 22 Utah 2d 27, 447 P.2d 908 (1968).
