Pushout schemes/stacks

I would like to know in what generality do we have pushouts for schemes/stacks/derived stacks. More precisely, let $f : X \rightarrow Y$ be a proper flat surjective morphism of schemes of finite type over $k$ and $g: X \rightarrow Z$ be an etale map. Is there a pushout $T$ (scheme? stacks? derived scheme?) that makes the diagram commutative:

$$\begin{matrix} X & \rightarrow & Z \\ \downarrow & & \downarrow \\ Y & \rightarrow & T \end{matrix}$$

I think that if $f : X \rightarrow Y$ is assumed to be a closed immersion, then Ferrand proved that such a pushout exists in the category of schemes. But I am really interested when $f : X \rightarrow Y$ is a proper flat surjective morphism.

EDIT : People gave me all sorts of nice references, but whatever the level of abstraction (schemes, stacks, derived stacks) the theorems they refer to always concern closed immersions. However, there are some "trivial" cases where the pushout exists without closed immersions coming into the picture. For instance, assume that $g : X \rightarrow Z$ is the quotient of $X$ by a finite group $G$ acting transitively without fixed points and assume that $f$ is $G$-equivariant. Then, it seems clear that the pushout exists.

If you remove the $G$-equivariant assumption on $f$, but you impose some regularity (like flatness or smoothness), I was wondering if the pushout still exists, perhaps as a very abstract object (derived stack?)?

• It is false for $T$ a scheme with the "expected" space with $X$ finite etale over $Y$ and $Z$. Let $Z$ be a separated finite type $k$-scheme with a free action by a finite group $G$ such that the separated algebraic space $Z/G$ is not a scheme (these exist). Then $X=Z \times_{Z/G}Z$ is a scheme finite etale over $Y=Z$ and $Z$ with $Z/G$ an algebraic space pushout. If $T$ were a scheme pushout of finite type over $k$ with the "expected" underlying space then the unique $Z/G\rightarrow T$ is separated and quasi-finite, so $Z/G$ is a scheme since $T$ is. Commented Jul 23, 2013 at 20:22
• You may want to look at the appendix to version 1 of J. Hall and D. Rydh's "The Hilbert Stack". arxiv.org/abs/1011.5484v1 Commented Jul 23, 2013 at 20:24
• Since it doesn't seem to have been mentioned yet, the title of Ferrand's paper is "Conducteur, descent, et pincement". Commented May 2, 2017 at 14:28

• I did not read Karl's paper completely, but it seems it only deals with closed immersions. I am really interested in the case where $f$ is NOT a closed immersion (but a flat proper surjective morphism). Commented Jul 23, 2013 at 19:55