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.
Tested against PostgreSQL 16

Note

This makes PostgreSQL migrations significantly safer than MySQL migrations.