2.5 Can DDL Be Rolled Back?
When you learn about transactions in Chapter 4, you will find that "if you ran something wrong, you can just roll back." Can DDL be rolled back too? After all, modifying the catalog is also a data change. In fact, it depends on the database.
PostgreSQL and SQL Server can run most DDL inside a transaction and roll it back. A flow in which you create a table, add a column, and cancel everything at once if there is a problem is possible. MySQL and Oracle, on the other hand, automatically commit the transaction up to that point when they encounter DDL. Each DDL statement is committed definitively when it finishes and cannot be undone by rollback.