The query ran. The table was too rigid. You needed a new column.
Adding a new column seems simple, but in production systems it’s a decision with real impact. Schema changes touch performance, availability, and future development speed. The right approach depends on your database engine, migration strategy, and operational constraints.
In relational databases like PostgreSQL or MySQL, adding a new column is done with ALTER TABLE. On small tables it’s instant. On large tables, it can lock writes or trigger full table rewrites. This can cause downtime if you run the command directly in production. Many teams use online schema change tools like pg_online_schema_change or gh-ost for zero-downtime migrations.
Deciding column data type is more than a storage choice. It shapes query performance, index design, and data integrity. Choosing TEXT for convenience can create downstream cost in indexing and materialized views. Choosing a type with clear constraints enforces business rules in the database.