Transactional DDL

Data Definition Language (DDL) statements are fully transactional in NuoDB.

This means that the changes do not occur until the transaction that made them successfully commits. If the transaction rolls back the DDL statements also rolls back. The same visibility rules apply to DDL in NuoDB as to all Data Manipulation Language (DML) statements.

NuoDB’s DDL statements are: CREATE, ALTER (except ALTER DATABASE), DROP, GRANT, MAP PARTITION, RENAME TABLE, REVOKE, TRUNCATE, and UNMAP PARTITION.

Statements managing users, grants and roles are also transactional.

Exceptions:

  1. ALTER DATABASE is used to control on-disk encryption and garbage collection. These are not DDL, so ALTER DATABASE is not transactional. It runs immediately and cannot be rolled back.

  2. CREATE INDEX …​ ONLINE uses two transactions (as described in CREATE INDEX).

  3. Partitioning DDL on an existing table is executed immediately by forcing the client transaction to commit and using a new dedicated transaction to run and commit the DDL. This applies only when using ALTER TABLE to change partitioning options. For a complete discussion on this topic, refer to Table Partitions and Storage Groups.

The full list of DDL statements (all defined in the SQL Statements reference section):

ALTER FUNCTION

CREATE FUNCTION

DROP FUNCTION

-

CREATE INDEX (but see above)

DROP INDEX

ALTER PROCEDURE

CREATE PROCEDURE

DROP PROCEDURE

-

CREATE ROLE

DROP ROLE

-

CREATE SCHEMA

DROP SCHEMA

ALTER SEQUENCE

CREATE SEQUENCE

DROP SEQUENCE

ALTER TABLE (but see above)

CREATE TABLE

DROP TABLE

ALTER TRIGGER

CREATE TRIGGER

DROP TRIGGER

ALTER USER

CREATE USER

DROP USER

ALTER VIEW

CREATE VIEW

DROP VIEW

GRANT

REVOKE

-

MAP PARTITION

UNMAP PARTITION

-

RENAME TABLE

TRUNCATE

-

MAP PARTITION and UNMAP PARTITION are deprecated in NuoDB 5.1.