The table was growing. You needed one more field. The query was tight, the schema solid, but the business rules changed. You have to add a new column.
A new column is one of the most common changes to a database. It can be trivial or dangerous, depending on the size of your data, the uptime requirements, and your tooling. A poorly executed schema change can lock tables, block writes, or even bring down production.
Start with clarity. Identify the exact column name, data type, nullability, and default values. Make sure the naming conventions match the rest of the schema. Avoid vague names. Every new column should have a clear purpose.
In relational databases like PostgreSQL or MySQL, ALTER TABLE is the command you will use. But the context matters. On a small dev table, it’s instant. On a production table with millions of rows, an ALTER TABLE ADD COLUMN can take seconds or hours, depending on the engine and configuration. For PostgreSQL, adding a new nullable column with no default is usually fast—it stores the definition without rewriting data. MySQL may handle it differently, and certain column types can trigger a full table rebuild.