LOG

Returns the logarithm to the specified base of the argument. The data type of the return value is the same data type as the passed parameter.

Behavior Type

Immutable

Syntax

LOG ( [ base, ] expression )

Parameters

base

Specifies the base (default is base 10)

expression 

An expression of type INTEGER or DOUBLE PRECISION

Examples

=> SELECT LOG(2.0, 64);
 LOG 
-----
   6
(1 row)
SELECT LOG(100);
 LOG 
-----
   2
(1 row)