How to Add a Column in PostgreSQL

Here's an example of adding a created_at timestamp column to your users table in PostgreSQL.

alter table users add column created_at timestamp without time zone;

Adding a string (varchar) column with a not null constraint:

alter table users add column bio character varying not null;

Adding a boolean column with a default value:

alter table users add column active boolean default true;

For reference, check out the full list of Postgres data types.

database icon
From PostgreSQL query to chart to Slack in seconds
Get to answers faster, together, with PopSQL and PostgreSQL