  Let V be a normal affine variety over the real numbers R, and let S be a
semi-algebraic subset of V(R). We study the subring B(S) of the coordinate ring
of V consisting of the polynomials that are bounded on S. We introduce the
notion of S-compatible completions of V, and we prove the existence of such
completions when V is of dimension at most 2 or S=V(R). An S-compatible
completion X of V yields an isomorphism of B(S) with the ring of regular
functions on some (concretely specified) open subvariety of X. We prove that
B(S) is a finitely generated R-algebra if S is open and of dimension at most 2,
and we show that this result becomes false in higher dimensions.
