In SQL, adding a new column is a simple operation, but the implications can be complex. When a database grows, schema changes affect performance, queries, and downstream systems. Adding a column without a plan can damage indexes, break ETL jobs, and slow critical workloads.
To add a new column in PostgreSQL:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This command updates the schema instantly for small tables, but on large tables it can lock writes. In MySQL, the syntax is similar:
ALTER TABLE users ADD COLUMN last_login DATETIME;
The differences between engines matter. PostgreSQL can often add a nullable column without rewriting the table. MySQL may rebuild it, consuming CPU and I/O. Always check documentation and test in staging before changing production.