Let $X$ be a Noetherian integral affine scheme. Let $U\subset X$ be an open subscheme whose complement has irreducible components of codimension $1$. Is $U$ affine?

Some remarks:

- By EGA 4, Cor. 21.12.7, the complement of a codimension 2 closed subset is not affine.
- if $X$ is the spectrum of a UFD, then I believe this can not happen. The ideal defining the complement has height 1. Thus the radical has height 1, so it is an intersection of prime ideals of height 1 so it is principal.
- if $X$ is of Krull dimension 1 (e.g. Dedekind domain), this can not happen.

Foundations of Algebraic Geometry, exercise 19.11.H, the same example is given and it is stated that it is not noetherian… I'm afraid I can't remember why just now. On the other hand this note by Ojanguren (in French) gives a simpler example, with a proof of non-noetherianness… but without the assumption of integrality. $\endgroup$1more comment