3 ms·
SQL functions can be non-deterministic just fine. E.g. SQL:2003 grammar defines DETERMINISTIC | NOT DETERMINISTIC characteristic for CREATE FUNCTION. Or, e.g. P
by drdaeman 2y ago
SQL functions can be non-deterministic just fine. E.g. SQL:2003 grammar defines DETERMINISTIC | NOT DETERMINISTIC characteristic for CREATE FUNCTION. Or, e.g. PostgreSQL has IMMUTABLE | STABLE | VOLATILE clauses.
- korkybuchek 2y agoNice, TIL. Thanks!
- yen223 2y agoThat's how something like `clock_timestamp()` can be supported. It returns the timestamp at time of execution, so it can change even within the same query if called multiple times: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT https://www.postgresql.org/docs/current/functions-datetime.h...