How to Change a Column Type in PostgreSQL
Last updated July 24, 2026 · By the SaturnSQL team
Use ALTER TABLE ... ALTER COLUMN ... TYPE, adding USING when the cast is not implicit. Some changes (e.g. int to text) rewrite the whole table and lock it, so schedule them on big tables.
ALTER TABLE orders ALTER COLUMN amount TYPE NUMERIC(12,2);With an explicit cast (USING)
ALTER TABLE events ALTER COLUMN payload TYPE jsonb USING payload::jsonb;
ALTER TABLE users ALTER COLUMN signup_date TYPE date USING signup_date::date;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