The table was broken. Data piled into the wrong places. The fix was simple: add a new column.
In every database, a new column is a statement of intent. You change the schema. You change the future. Whether you are altering a relational database like PostgreSQL or MySQL, or modifying a NoSQL document in MongoDB, adding a new column has consequences for performance, integrity, and deployment timelines.
The first step is understanding the scope. Will the new column store nullable values or should it have a default? Will it be indexed? Will old data need a migration? Each choice affects how queries run and how code interacts with the model.
In SQL, adding a new column is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT NOW();
This command changes the schema instantly on small tables. On large datasets, it can lock writes or slow reads. Some systems allow adding a new column with constant default values without rewriting the whole table. In PostgreSQL 11+, adding a column with a constant default is metadata-only. This means the ALTER is fast, and the physical storage updates later when rows are touched.