Do the action blocks of an ALTER TABLE statement run atomically?
Every SQL statement is run inside a transaction. At minimum (and by default) each statement runs in its own transaction.

The documentation says:


  By default (without BEGIN), PostgreSQL executes transactions in &ldquo;autocommit&rdquo; mode, that is, each statement is executed in its own transaction and a commit is implicitly performed at the end of the statement (if execution was successful, otherwise a rollback is done).


So either both actions succeed, or both are rolled back.