17 ms·
In Postgres terminology, all functions have a volatility classification: IMMUTABLE (input X will always return y forever), STABLE (input x will always return y
by teej 4y ago
In Postgres terminology, all functions have a volatility classification: IMMUTABLE (input X will always return y forever), STABLE (input x will always return y for the current statement) and VOLATILE (input x can return anything). That classification impacts how the query gets planned and optimized. All the dbs I know have some version of this.
now() should be STABLE in pretty much every db, but not every db gracefully handles STABLE function calls in predicates.
You probably know all this but figured I'd share the database jargon for everyone else.