4. Given a prime number $p$ such that $p^{3}-6 p^{2}+9 p$ has exactly 30 positive divisors. Then the smallest value of $p$ is $\qquad$ .
4. 23 .

Obviously, when $p=2$ or 3, it does not meet the requirements of the problem.
Therefore, $p>3$.
Also, $p^{3}-6 p^{2}+9 p=p(p-3)^{2}$, at this point,
$(p, p-3)=(p, 3)=1$.
Since $p$ has two factors, $(p-3)^{2}$ has 15 factors.

And $15=5 \times 3$, to make $p$ the smallest, $p-3$ is also even, so it can only be
$(p-3)^{2}=2^{4} \times 3^{2}$ or $2^{4} \times 5^{2}$.
Thus, $p=15$ (discard) or 23 .
Therefore, the minimum value of $p$ is 23 .