Adding a new column is simple in concept, but performance, downtime, and integrity can all be at risk if done without care. Schema changes can block writes, lock reads, or fail in production if constraints are not planned. The safest way to add a new column depends on the database engine, the size of the table, and the load on your system.
In PostgreSQL, you can add a new column without a table rewrite if you set a default of NULL. Use:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
Adding a default value with ALTER TABLE ... ADD COLUMN ... DEFAULT will rewrite the entire table in older versions, causing possible downtime. Newer versions optimize this, but check your environment before deploying.
In MySQL, a new column is often an online operation with ALGORITHM=INPLACE, but not all storage engines support it. For large tables, consider ALTER TABLE ... ALGORITHM=INPLACE, LOCK=NONE to avoid blocking reads and writes.