Skip to content
ParticleDB

Schema changes and transactions

Run schema setup outside application transactions. For example, create the table in autocommit mode before starting a transaction that writes its records. The behavior depends on the server version and settings, as described below.

Migration tools that automatically wrap schema changes in a transaction need a separate migration configuration. Do not claim PostgreSQL-style transactional schema changes from a successful connection alone.

The downloadable 1.1.19-rc.12 server enables transactional schema changes by default on a single node with --txn-mode occ or serializable. It supports CREATE TABLE, CREATE [UNIQUE] INDEX, ALTER TABLE ... ADD COLUMN and DROP TABLE in a transaction. --transactional-ddl off, --txn-mode fast and replicated configurations reject those commands in a transaction.

Earlier builds can reject schema commands inside a transaction and may not accept --transactional-ddl. Check particledb --version and particledb start --help before configuring a migration tool.

  1. Back up or export using a supported recovery path.
  2. Test the migration on representative data.
  3. Check application compatibility before and after the change.
  4. Apply the change during an appropriate deployment window.
  5. Verify the schema and representative reads and writes.

If a schema command is refused inside a transaction, roll back and use its documented standalone path. Do not disable transaction handling globally without checking the rest of the migration.

Frameworks may assume PostgreSQL-specific catalog functions, lock behavior or fully transactional DDL. A working client connection does not establish full migration-tool compatibility. See ORM integration.

Schema reference · Upgrades

Documentation home · Troubleshooting