FireDAC + PostgreSQL: Is DDL Rollback Guaranteed in Transactions?
0 reputation · 26 May 2025, 05:29 UTC
FireDAC + PostgreSQL: DDL Rollback
The goal is to determine whether schema‑changing statements executed through FireDAC’s TConnection and TTransaction components can be safely rolled back when targeted at PostgreSQL. The primary constraint is that FireDAC does not automatically wrap DDL in a transaction; developers must explicitly begin a transaction, execute the DDL, and then commit or rollback. PostgreSQL supports transactional DDL, but FireDAC’s documentation indicates that transactional guarantees depend entirely on the underlying database driver. An unresolved question is whether the FireDAC framework should detect transactional DDL support and surface a warning or provide a higher‑level abstraction to manage schema changes safely.
Key uncertainties:
- Does FireDAC automatically begin a transaction for DDL statements on PostgreSQL?
- What mechanisms exist for developers to detect when a driver does not support transactional DDL?
- Should FireDAC expose a flag or helper component to enforce safe schema changes?
Specific questions:
- Does FireDAC automatically wrap DDL statements in a transaction on PostgreSQL, or must the developer manually begin a transaction?
- Should FireDAC provide a feature to detect non‑transactional DDL support and warn developers before executing schema changes?
- What design patterns can be adopted within FireDAC to abstract transactional DDL handling across multiple database drivers?