Adding a new column sounds simple. In practice, it can be the point where design meets reality. Every database—PostgreSQL, MySQL, SQLite—has its own mechanics. The choice between ALTER TABLE and creating a migration is more than syntax. It’s about safety, downtime, and the way your system evolves.
In PostgreSQL, ALTER TABLE ADD COLUMN is instant for nullable fields without defaults, but costly if you set a default value on large tables. MySQL may lock the table depending on the storage engine. SQLite rewrites the table file entirely. Knowing these differences keeps operations fast and stable.
Adding a non-nullable column means either a default value or backfilling data. Backfills can choke your write throughput if unplanned. For high-traffic systems, chunk updates and throttle writes. Schema migrations with tools like Liquibase, Flyway, or Prisma control the push from dev to production.