Under what condition is an electrostatic field both solenoidal and irrotational? I'm trying to figure out

under what condition is an electrostatic field both solenoidal and irrotational?

A solenoidal field satisfies $\nabla \cdot \mathbf{F}=0$. An irrotational field satisfies $\nabla \times \mathbf{F}=\mathbf{0}$.
From the fundamental postulates in electrostatics we have $\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}\:$ and $\: \nabla \times \mathbf{E}=\mathbf{0}$.
So obviously, an electrostatic field is always irrotational, but when is the field solenoidal?
One condition would be when there is no charge density, $\rho=0$. Then clearly $\nabla \cdot \mathbf{E}=0$. But if there is no charge density is there even an electric field to begin with?
Another condition would be if the electrostatic field is homogeneous, that is, it doesn't depend on spacial coordinates. For example, $\mathbf{E} = \mathbf{a_x}+\mathbf{a_y}2+\mathbf{a_z}3 \: $ satisfies $\nabla \cdot \mathbf{E} = 0$.
Does anyone know an exact formulation of what the condition should be, for the electrostatic field to be both solenoidal and irrotational?
 A: I do not understand well the  question. Are we discussing the existence of an electric field which is irrotational and solenoidal in the whole physical  three-space or in a region of the physical three-space?
Outside a stationary charge density $\rho=\rho(\vec{x})$ non-vanishing only in a bounded region of the space, the produced static electric field is both irrotational and solenoidal. The specific form of $\rho$ is irrelevant.
If instead we are really considering the whole space without charges, a physically meaningful result is the following one.
The only possible static electric field (continously differentiable) defined in the whole three space without charges and such that its total energy is finite, i.e.,
$$\frac{\epsilon_0}{2}\int_{\mathbb{R}^3} \vec{E}(\vec{x})^2 d^3x <+\infty\tag{1}$$
is  $\vec{E}(\vec{x})= \vec{0}$ everywhere.
Notice that $\vec{E}$ above  is necessarily  irrotational and solenoidal on the whole space, and vice versa, as a consequence of the Maxwell equations.
The assertion is true because $\nabla \times \vec{E}=0$ implies, in the whole space (simply connected), $\vec{E} = \nabla \phi$ for some scalar field $\phi$.
The requirement $\nabla \cdot \vec{E}=0$ implies $\Delta \phi=0$.
In turn, this condition implies that $\phi$ is smooth ($C^\infty$) and thus $\vec{E}$ admits second derivatives, in particular.
Obviously $\Delta E_k = \Delta \partial_k \phi = \partial_k \Delta \phi=0$.
Every component $E_k$ of $\vec{E}$ is therefore a harmonic function ($\Delta E_k =0$) on the whole space $\mathbb{R}^3$ and, due to (1), it also satisfies
$$\int_{\mathbb{R}^3} E_k(\vec{x})^2 d^3x <+\infty\quad k=1,2,3\:.$$
A known result of harmonic function theory  states that a (real valued) harmonic function $f$ defined on the whole $\mathbb{R}^n$ such that the integral of $f^2$ is finite must be necessarily the zero function.
A: You've identified that E-field can be both  solenoidal and lamellar when the charge density is zero, but it is actually possible that the E-field is not solenoidal at points in space without charge densities. Likewise, it is possible for the E-field to be solenoidal even when there is charge density.
According to  Maxwell's equations:
$$\nabla \times \mathbf{E} = 0,$$
$$\nabla \cdot \mathbf{D}  = \nabla \cdot (\varepsilon \mathbf{E}) = \varepsilon \nabla \cdot \mathbf{E}  +  \mathbf{E}\cdot\nabla\varepsilon = \rho,$$
then it follows that
$$ \nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon}-\mathbf{E}\cdot \nabla\ln\varepsilon .$$
If the permittivity is not spatially constant it is then possible for the electric field to not be solenoidal despite there being no charge density. Likewise, it is possible to construct a spatially varying permittivity so that the E-field is solenoidal despite there being charges.
