The query finished running, but the table was missing a field you needed. You typed the command again, this time adding a new column.
A new column is more than a structural change in a database. It modifies how data is stored, queried, and understood. Adding one at the wrong time can trigger heavy table locks, cascade schema changes, and break downstream processes. Done well, it opens the door for new features, migrations, or analytics insights. Done poorly, it creates bottlenecks and outages.
When creating a new column, plan its type, nullability, and default values. Know how it interacts with indexes and constraints. Consider backward compatibility for services reading the table. Test the change in a staging environment with realistic data volume. Measure the migration duration and locking behavior.
SQL syntax varies across engines. In PostgreSQL, you run: