If you’re getting an error that reads “ERROR: cannot take logarithm of zero” when using either the log()
function or log10()
function in PostgreSQL, it’s probably because you’re passing an argument of zero.
These functions require a value greater than zero. This is true even for the base argument of the log()
function (the argument that specifies which base to use).
To fix this issue, be sure to pass a value greater than zero to these functions.
Continue reading