Hermite polynomials form a complete orthonormal basis of the weighted $L^2(\mathbb R, w \; dx)$ space, with inner product $$ \langle f, g \rangle_w = \int_\mathbb R f(x) g(x) \; w(x) dx. $$
A short Wikipedia proof shows that if for any $f \in L^2(\mathbb R, \exp (-x^2) \; dx)$ we have $\forall n \geq 0$ $$ \int_\mathbb R f(x) x^n e^{-x^2} dx = 0 \; \Longrightarrow \; f = 0 \; a.e. $$ then these weighted polynomials form a complete basis (orthonormal after Gram-Schmidt). Wikipedia then says "Variants of the above completeness proof apply to other weights with exponential decay."
My question is: What are the precise conditions on $w(x)$ with respect to which an inner product is defined to preserve completeness of the polynomial basis? Is exponential decay necessary, or merely sufficient? For example, are all of these heavy-tailed densities ruled out? Thanks.