To add a boolean column to a table:

ALTER TABLE table_name ADD COLUMN col_name BOOLEAN;

Then set a default value for the new column in a separate statement:

ALTER TABLE table_name ALTER COLUMN col_name SET DEFAULT FALSE;

Or you can put them all together in a single statement:

ALTER TABLE table_name
	ADD COLUMN "col_name" BOOLEAN DEFAULT FALSE;

This way might take longer if the operation is huge.

You should also update the nullability of the new column:

ALTER TABLE table_name ALTER COLUMN col_name SET NOT NULL;

Need a good GUI Tool for PostgreSQL? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.


Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS.

TablePlus GUI Tool PostgreSQL