You may rollback the DDL in PostgreSQL
PostgreSQL allows Data Definition Language (DDL) commands, which modify the structure of the data, to be executed within a transaction block.
In most commercial database systems, executing a DDL command will automatically commit the current transaction. However, this automatic commit does not happen in PostgreSQL.
With few exceptions like DROP DATABASE and CREATE/DROP TABLESPACE, PostgreSQL ensures all DDL operations are transactional.
You may rollback the DDL command as you wish.

Hope it helps.


Leave your comment