The query hit the database like a hammer, and the result set was wrong. The reason was simple: the schema had changed, and the new column wasn’t there when you needed it.
Adding a new column sounds small, but it can dissolve uptime and wreck performance if done without care. Whether it’s PostgreSQL, MySQL, or a columnar store, the same truth holds: schema migrations are a live operation. Add a column without locking strategy, index planning, or deployment sequencing and you trade stability for chaos.
The process starts with clarity. Define the column name, data type, and default values. Check constraints and relationships. For large tables, avoid blocking writes — use tools or mechanisms that support concurrent schema changes. In PostgreSQL, ADD COLUMN with a default and NOT NULL can rewrite the whole table; in production, that can mean downtime. In MySQL, adding a column with ALGORITHM=INPLACE and LOCK=NONE mitigates risk but still deserves testing.