TITLE: Normality for non-noetherian schemes
QUESTION [7 upvotes]: I am interested to know to what extent the notion of normality makes sense on a non-noetherian scheme.
Specifically, I can ask the following question: let $\pi:X\to Y$ be a formally smooth morphism of schemes.
Assume that $Y$ is noetherian and normal. Let $U\subset Y$ be an open subset such that the complement has codimension $\geq 2$. Let $f$ be a regular function on $\pi^{-1}(U)$. 
$\mathbf{Question:}$ Is it true that $f$ extends to all of $X$?

REPLY [2 votes]: No, it is not true. I'm going to describe everything in terms of commutative algebra, so take $X=Y=\operatorname{Spec} R$.
Let $G$ be the group $\mathbb Z \times \mathbb Z$ with the lexicographic ordering. Let $R$ be any valuation ring with value group $G$ and then $R$ has dimension $2$ since it has exactly three prime ideals, forming the chain:
$$\mathfrak m = \{ r \in R \mid v(r) \geq (0, 1) \} \supset \mathfrak p = \{ r \in R \mid v(r) = (a, b) \mbox{ where } a \geq 1\} \supset 0,$$
where $v$ denotes the valuation. Let $t$ be any element of valuation $(0,1)$ so that the vanishing set of $t$ is the single closed point $\mathfrak m$. Thus, $1/t$ is a regular function on $U = X \setminus \mathfrak m$, but $1/t$ is not in $R$ even though $\mathfrak m$ has codimension 2.
I think about the result for Noetherian normal rings in terms of two separate results: First, if $R$ is a Noetherian domain, then $R$ is the intersection of $R_{\mathfrak p}$ as $\mathfrak p$ ranges over all associated primes of principal ideals. Second, in a normal Noetherian domain, all associated primes of principal ideals have codimension 1 (this is condition S2 of Serre). I suspect that the first might generalize to non-Noetherian rings, provided that you have the right definition of associated prime. The second fails pretty much as badly as possible, since a single element can generate a prime ideal of arbitrary codimension, or even infinite codimension.