Adding a new column is one of the most common schema changes in application development. Done wrong, it can lock tables, slow queries, and break production. Done right, it maintains uptime, preserves data integrity, and enables features without risk.
A new column changes the shape of your data. Whether you are working with PostgreSQL, MySQL, or a managed cloud database, the process must be planned. Start by defining the column: name, data type, default value, and constraints. For zero-downtime migrations, avoid adding columns with non-null defaults directly; create them as nullable, backfill in batches, then enforce constraints.
Schema migration tools handle this differently. In PostgreSQL, ALTER TABLE ADD COLUMN is fast when not backfilling data. In MySQL, adding a column can lock the table depending on engine, version, and column type. For large datasets, online schema change tools like pt-online-schema-change or gh-ost keep systems responsive.