Let $f\colon X\to D$ be a morphism of a complex analytic space $X$ into the 1-dimensional disk $D$. Assume for simplicity that $X$ has a single irreducible component which may not be reduced. 


**Question: is it true that if $f$ is onto then $f$ is flat?**


(I am not a specialist, and the answer is not known to me even if $X$ is reduced.)


If the answer is no, I would be curious to know if there is a correct reformulation of this result and what is the natural generality. Of course, a reference will be most useful.


This question is an analytic version of the following well known algebraic criterion.
Let $f\colon X\to Y$ be a morphism of schemes when $Y$ is integral regular 1-dimensional. Assume for simplicity that $X$ is reduced and irreducible (these conditions may be relaxed). Then $f$ is flat if and only if $X$ dominates $Y$. (See Hartshorne's book, Ch. III, Prop. 9.7.)



Flatness of a morphism of complex analytic spaces
There are easy counterexamples if you allow "embedded components", e.g. $X\subset D\times\mathbb{C}$ given (in coordinates $z,t$) by the equations $zt=t^2=0$. In the local ring at $x=(0,0)$, the coordinate $z$ from $D$ is a zero divisor, so $\mathscr{O}\_{X,x}$ is not flat over $\mathscr{O}\_{D,0}$.  

On the other hand, in the general case, flatness at $x\in X$ just means that $\mathscr{O}\_{X,x}$ is a torsion-free $\mathscr{O}\_{D,f(x)}$-module (because $\mathscr{O}\_{D,f(x)}$ is a PID), or simply that the function $z-f(x)$ is not a zero divisor in $\mathscr{O}\_{X,x}$. This will hold if you assume that $X$ has no embedded component at $x$, in the sense that every zero divisor in $\mathscr{O}\_{X,x}$ is nilpotent (indeed, with your assumptions, $z-f(x)$ is certainly not nilpotent).
In particular, $f$ is flat if $X$ is (irreducible and) reduced (and of course you may replace "onto" by "nonconstant").


