PostgreSQL v12 introduced log10()
as an alias for the single-argument invocation of log()
. However, most hosting providers are still on PostgreSQL v11 or earlier at this time, which do not support log10()
. In order to make code portable, how can log10()
be aliased to log()
in earlier version of PostgreSQL?
Asked
Active
Viewed 188 times
0

Quolonel Questions
- 6,603
- 2
- 32
- 33
-
Does this answer your question? [Function alias for Postgres default function](https://stackoverflow.com/questions/40300728/function-alias-for-postgres-default-function) – Marth Feb 22 '20 at 16:45
-
Just use log(x). [Postgres v12 Mathematical Functions](https://www.postgresql.org/docs/current/functions-math.html) contains both log(x) and log10(x) but both return log to base 10. So its portable for v10 to v12. The only Problem would be downgrading from v12 to v10. – Belayer Feb 22 '20 at 23:03
-
@Belayer My code has to be portable cross-systems, so I need `log10()`. – Quolonel Questions Feb 23 '20 at 09:12