How to use flatness here? Let $X\to S$ be a scheme. 
Definition: A relative effective Cartier divisor on $X/S$ is a closed subscheme $D\subset X$ such that the ideal sheaf $I$ of $D$ is invertible and $D\to S$ is flat.
Let now $T\to S$ be another scheme over $S$ and denote by $X_T$ the fibered product $X\times_S T$. I read on a paper the following:
Claim: Let $D$ be a relative effective Cartier divisor on $X_T/T$ and $p:T'\to T$ be an arbitrary $S$-map of schemes. Then the pullback $p^*_{X_T}(I)$ is the ideal sheaf of the $T'$-flat closed subscheme $D_{T'}\subset X_{T'}$. Hence $D_{T'}$ is a relative effective Cartier divisor on $X_{T'}/T'$.
Can you please help me proving the claim? In particular, the author says:

Since $D$ is $T$-flat, $p^*_{X_T} (I)$ is equal to the ideal of $D_{T'}$

And I don't understand why.
 A: Ok I think I really got it now! A nice way to prove the above claim is to use a basic result about purity:

The functor $\square\otimes_A B$ is exact if and only if every short exact sequence of $A$-modules ending with $B$ is pure

Recall that a short exact sequence of $A$-modules is pure if it stays exact when tensored with any $A$-module.
$\newcommand{\Spec}{\operatorname{Spec}}$
$\newcommand{\SES}[3]{0\to #1 \to #2 \to #3 \to 0}$
Let's work affine locally, with
$$ T=\Spec(R), \quad T'=\Spec(R'), \quad X_T=\Spec(S),  \quad X_{T'}=\Spec(S') $$
and let $I\subset X_T$ be the ideal of $D$ and $I'$ the ideal of $D'=p^*{D}$.
Flatness of the map $D\to T$ is equivalent to the functor $\square\otimes_R S/I$ being exact. By the above result this implies that every short exact sequence of $R$-modules ending with $S/I$ is pure. In particular the sequence of $D$
$$ \SES{I}{S}{S/I} $$
is pure. Hence tensoring with any $R$-module leaves it exact and in particular
$$ \SES{I\otimes_R R'}{S\otimes_R R'}{S/I\otimes_R R'} $$
is exact. Since the above sequence can be rewritten as
$$ \SES{p^*I}{S'}{S'/I'} $$
we deduce that $p^*I = I'$, as desired.
