select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 7.0
Historical version. PostgreSQL 7.0 reached end of support in May 2005. See the current manual for supported releases.

Boolean Type

Postgres supports bool as the SQL3 boolean type. bool can have one of only two states: 'true' or 'false'. A third state, 'unknown', is not implemented and is not suggested in SQL3; NULL is an effective substitute. bool can be used in any boolean expression, and boolean expressions always evaluate to a result compatible with this type.

bool uses 1 byte of storage.

Table 3-17. Postgres Boolean Type

State Output Input
True 't' TRUE, 't', 'true', 'y', 'yes', '1'
False 'f' FALSE, 'f', 'false', 'n', 'no', '0'

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.