boolean type

boolean data expresses a binary value of either TRUE or FALSE.

Detail Info
Quick Syntax TRUE or FALSE
Size 1 byte
Aliases bool
Catalog name pg_catalog.bool
OID 16

Syntax

TRUE FALSE

Details

Valid casts

From boolean

You can cast from boolean to:

  • int (explicitly)
  • text (by assignment)

To boolean

You can cast the following types to boolean:

Examples

SELECT TRUE AS t_val;
 t_val
-------
 t
SELECT FALSE AS f_val;
 f_val
-------
 f
Back to top ↑