How to Add a Column in PostgreSQL

Last updated July 24, 2026 · By the SaturnSQL team

Use ALTER TABLE ... ADD COLUMN. Since Postgres 11, adding a column with a constant DEFAULT is instant and does not rewrite the table, so it is safe on large tables.

ALTER TABLE orders ADD COLUMN discount NUMERIC(5,2) DEFAULT 0;

Multiple columns, only if missing

ALTER TABLE orders
  ADD COLUMN IF NOT EXISTS status TEXT,
  ADD COLUMN IF NOT EXISTS updated_at TIMESTAMPTZ;

A volatile default (e.g. now() at add-time is fine, but random() or a subquery) forces a full table rewrite; add the column first, then backfill in batches.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related PostgreSQL guides

© 2026 Panda Capital Oy Ab. All rights reserved.