Scalar. Converts a given value to a Boolean value.
to_boolean ( value )
value | A string, or a Boolean value. |
Converts a given string to a Boolean value. The function takes a string as its argument, and the function returns a Boolean value. Note that the function can also take a Boolean value as its argument, but it will return the same Boolean value.
The strings "True", "Yes", and "On", regardless of case, or the numeral "1" returns TRUE. NULL returns NULL. Any other string returns FALSE.
to_boolean ('1')returns TRUE.
to_boolean ('FALSE')returns FALSE.
to_boolean ('example')returns FALSE.