AdvancedAdvanced PostgreSQL
Theory: PostgreSQL vs MySQL - DDL in Transactions
The query
SQL
-- Q: Can you rollback a table creation?
-- A: In PostgreSQL, YES. Almost all DDL (CREATE/ALTER/DROP) commands are
-- fully transactional. You can BEGIN, drop a table, and ROLLBACK safely.
-- In MySQL, DDL commands trigger an implicit COMMIT, meaning they
-- cannot be rolled back.Note
“This makes PostgreSQL migrations significantly safer than MySQL migrations.