Let $X$ be a locally Noetherian scheme and let $f$ be a rational function on $X$ (i.e. the equivalence class of a pair $(U,f)$, where $f \in \mathcal{O}_X(U)$ and $U$ contains the associated points of $X$, under obvious equivalence relation).
While reading Vakil's notes I wondered how could we define poles of such a rational function. After some thought I came up with the following definition: I'd say that a regular codimension one point $p$ is a pole if it's not in the domain of definition of $f$. If $X$ is also an integral scheme (or at least if all the stalks of $\mathcal{O}_X$ are integral domains, in which case we can cover $X$ with integral schemes), then this definition would coincide with the usual one, namely using the discrete valuation at $p$.
But there is something unnatural about my definition, since I was not able to relate the rational function with the discrete valuation on $\mathcal{O}_{X,p}$ and consequently was not able to determine the order of the pole. So I'd like to know if it's possible to define a meaningful notion of poles for rational functions on locally Noetherian schemes and how would it relate to my definition. By extension, consider the same question about zeros.
The order of vanishing of a rational function is only defined on locally noetherian, integral schemes, at points of codimension 1. The locally noetherian and codimension 1 conditions are to ensure that the order is finite, and that the maps $\mathrm{ord}_x : R(X) \to \mathbf{Z}$ are homomorphisms; see (Stacks, Comm. alg., Orders of vanishing). And the integrality assumption is so that rational functions correspond to elements of the fraction fields of stalks; otherwise as you see yourself the definition doesn't work at all.
In practice this doesn't really present a problem. For example when considering Weil divisors (1-codimensional cycles) associated to rational functions, if one has a Weil divisor associated to a rational function on a closed integral subscheme Z of X, one can consider the direct image of this cycle by the inclusion, to get a cycle on X. (This is how one defines rational equivalence of cycles.)