---
title: "Transactional DDL"
url: "https://docs.yugabyte.com/stable/architecture/transactions/transactional-ddl/"
---

# Transactional DDL

How YugabyteDB rolls back DDL statements that run inside a transaction block.

Data Definition Language (DDL) statements modify the structure of your data. PostgreSQL allows executing such statements within a transactional block and supports rolling them back as part of a transaction rollback. For two transactions undergoing conflicting DDLs, it also provides isolation guarantees by taking appropriate object locks during DDL processing.

YugabyteDB's transactional DDL provides similar guarantees for rolling back DDL operations done inside a transaction block. Because object locks are still under active development, isolation guarantees are weaker than in PostgreSQL. See [Limitations](#limitations "Limitations").

To try rolling back a DDL statement, see [Transactional DDL](/stable/explore/transactions/transactional-ddl/ "Transactional DDL").



## Enable transactional DDL

[EA](/stable/releases/versioning/#feature-maturity) Support for transactional DDL is disabled by default. To enable the feature, set the [yb-tserver](/stable/reference/configuration/yb-tserver/ "yb-tserver") flag `ysql_yb_ddl_transaction_block_enabled` to true.

Warning

Do not enable transactional DDL if you are using CDC. Transactional DDL currently doesn't support CDC in both [logical replication](/stable/architecture/docdb-replication/cdc-logical-replication/ "logical replication") (PostgreSQL) and the [gRPC protocol](/stable/architecture/docdb-replication/change-data-capture/ "gRPC protocol"). See [Limitations](#limitations "Limitations").

## Rollback capabilities

All DDLs supported in YugabyteDB provide the same rollback capabilities as PostgreSQL. These include DDLs on tables, indexes, roles, and materialized views.

Some DDL statements, such as DDLs on a database or tablespace, are disallowed in a transaction block in PostgreSQL, and are also disallowed in YugabyteDB.

## Limitations

- [Concurrent DDLs](/stable/best-practices-operations/administration/#concurrent-ddl-during-a-ddl-operation "Concurrent DDLs") on the same database are unsupported and will lead to conflict and read restart required errors. Your applications must handle these by retrying the statements.
- [Savepoints](/stable/develop/learn/transactions/transactions-retries-ysql/#savepoints "Savepoints") are unsupported for DDL statements. As a result, you cannot create a savepoint in a transaction block that has executed a DDL statement. Similarly, you cannot execute a DDL statement in a transaction block in which a savepoint has been created.
- Transactional DDL currently doesn't support CDC in both [logical replication](/stable/architecture/docdb-replication/cdc-logical-replication/ "logical replication") (PostgreSQL) and the [gRPC protocol](/stable/architecture/docdb-replication/change-data-capture/ "gRPC protocol"). You must not enable transactional DDL if you are using CDC.
