Can a local ring have more than one prime ideal?

A local ring is defined as a ring which has a unique maximal ideal. This unique maximal ideal consists of only non-units and contains all the non-units of the ring $R$. So examples of local rings include any field, or rings localised at prime ideals and so on.

My question is: can we have a local ring which has more than one prime ideal? I can't seem to think of any examples where this is the case.

(In response to the comments below, I have realised that when $R$ is a domain, then $(0)$ is also a prime ideal, but are there any examples where $R$ isn't a domain?)


This question is intimately tied to the idea of dimension. Given a commutative ring $R$, its (Krull) dimension is defined as the supremum of the lengths of chains of all prime ideals.

The name dimension for this quantity makes sense because the coordinate ring of an $n$-dimensional affine variety has Krull dimension $n$. Localization has a geometric interpretation, too: a prime ideal $\mathfrak{p}$ corresponds to an irreducible variety $V$. The localization $R_\mathfrak{p}$ consists of all rational functions that are defined at all points of $V$.

If $R$ is a local ring and its unique maximal ideal $\mathfrak{m}$ is the only prime ideal, then $R$ has dimension $0$, which, if $R$ is Noetherian, is equivalent to being Artinian.

The geometric interpretation above indicates how to produce a local ring with any number of prime ideals. Given a positive integer $n$, consider $n$-dimensional affine space $\mathbb{A}^n$ over a field $k$ of characteristic zero. Its coordinate ring is $k[x_1, \ldots, x_n]$, and if we localize at the prime (maximal, actually) ideal $(x_1, \ldots, x_n)$, we obtain the local ring $k[x_1, \ldots, x_n]_{(x_1, \ldots, x_n)}$ which consists of all rational functions on $\mathbb{A}^n$ that are defined at the origin. By the correspondence theorem for prime ideals in a localization, this ring has a chain of prime ideals $$ (0) \subsetneq (x_1) \subsetneq (x_1, x_2) \subsetneq \ldots \subsetneq (x_1, x_2, \ldots, x_n) $$ of length $n$.

As for an example where $R$ is not a domain: an affine variety is irreducible iff its coordinate ring is a domain, so we need to consider reducible varieties. Let $A = \frac{k[x,y]}{(xy)}$ which is the coordinate ring of the union of the lines $x = 0$ and $y = 0$ in the plane. Let $\mathfrak{m} = (x,y)$ and let $$ R = A_\mathfrak{m} = \left(\frac{k[x,y]}{(xy)}\right)_{(x,y)} $$ which is the local ring at the origin. Then $(x), (y)$, and $(x,y)$ are all prime ideals of $R$.


For an explicit example, consider $k[[x,y]]$, formal power series over a field $k$, in two indeterminates. The unique maximal ideal is the set of series with no constant term; among the nonzero prime ideals are $(x)$ and $(y)$.