Data Type Picker

PostgreSQL

Categories

PostgresGUI

Boolean

Just use boolean

boolean1 byteRecommended

Flags, toggles, yes/no fields.


Range

true / false / null

Performance

Extremely compact. Efficient in indexes and WHERE clauses.

Comparison

boolean vs smallint/char(1): always use boolean for true/false values. It's self-documenting, works with IS TRUE/IS FALSE syntax, and is the most storage-efficient option.

SQL Example
CREATE TABLE users (
  id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  is_active boolean NOT NULL DEFAULT true
);