Let $Z \to X$ be a closed immersion of schemes. Is it true that for every morphism $Z \to Y$, the pushout $X \cup\_Z Y$ in the category of schemes exists? If yes, a) does it turn out to be simply sthe pushout in the category of locally ringed spaces, b) is the natural morphism $Y \to X \cup\_Z Y$ a closed immersion?


In his paper "[Gluing Schemes and a Scheme Without Closed Points](http://www.math.psu.edu/schwede/Papers/SchemeWithoutPoints.pdf)", Karl Schwede studies such questions. In particular, he gives an affirmative answer if everything is affine (Theorem 3.4), but also for arbitrary schemes *if we also assume* that $Z \to Y$ is a closed immersion (Corollary 3.9). My intuition says that it should be also true if we drop this condition, but on the other hand the paper shows with some examples that our intuition may be wrong in the context of pushouts. I'm aware that colimits of schemes are not well-behaved in general, but in my research it would be useful to construct pushouts also when just one inclusion is a closed immersion.


As with [this](https://mathoverflow.net/questions/9961/colimits-of-schemes) MO question, I think it is not sufficient just to say that some pushout does not exist just because you don't see one. I'm interested in rigorous proofs.



Gluing along closed subschemes
In the positive direction, see D. Ferrand, "Conducteur, descente et pincement", Bull. SMF 131 (4), 2003, 553-585, especially Th. 5.4: the answer to all questions is yes if $Z\to Y$ is finite *and* every finite set in $X$ (resp. $Y$) is contained in an affine open subset.


More generally, assuming $Z\to Y$ affine, Theorem 7.1 gives a necessary and sufficient condition for the following to hold: (i) the pushout $X\cup\_Z Y$ (as locally ringed spaces) is a scheme; (ii) $Y\to X\cup\_Z Y$ is a closed immersion; (iii) $X\to X\cup\_Z Y$ is affine.


The condition is this: for each $y\in Y$, the inverse image of $\mathrm{Spec(\mathcal{O}\_{Y,y})}$ in $Z$ has a basis of affine open neighborhoods in $X$.


