Adding a new column to a database table is one of the most common schema changes. Done wrong, it locks writes, stalls reads, and risks production downtime. Done right, it’s invisible to users and safe under load.
Before you run an ALTER TABLE statement, consider table size, index impact, and concurrent activity. On large tables, a straightforward ALTER TABLE ADD COLUMN can block queries. Many relational databases—PostgreSQL, MySQL, MariaDB—have different behaviors. In PostgreSQL, adding a column with a default value rewrites the entire table unless using DEFAULT with NULL followed by an UPDATE. In MySQL, column addition can be instant with certain storage formats, but not all.
Steps for safe column creation: