Skip to main content
Version: 0.7.0

Schema Feature Support

This page records pgpac's current desired-state coverage. Native operations preserve the table and its remaining rows. Migration operations also preserve rows, but PostgreSQL must validate or convert existing data. Destructive operations require AllowDrop="true", --allow-drop, or --force.

Tables and columns

FeatureStatusPlanned behavior
Create tableNativeCREATE TABLE; requires AllowCreate.
Drop tableDestructiveDROP TABLE ... CASCADE; requires drop authorization.
Add columnNativeALTER TABLE ... ADD COLUMN; requires AllowAlter.
Drop columnDestructiveALTER TABLE ... DROP COLUMN without CASCADE; preserves remaining data.
Change column typeMigrationExplicit USING column::new_type conversion; incompatible values fail.
Set or remove a defaultNativeALTER COLUMN ... SET/DROP DEFAULT.
Set NOT NULLMigrationExisting rows are validated.
Remove NOT NULLNativeALTER COLUMN ... DROP NOT NULL.
Rename a columnNot inferredAppears as an added column plus a destructive removed column; values are not copied.

Integrity constraints

FeatureStatusPlanned behavior
Primary keyMigrationNative add, drop, rename, or replacement.
Foreign keyMigrationNative add, drop, rename, or replacement with target validation.
Unique constraintMigrationNative add, drop, rename, or replacement with existing-row validation.
Check constraintMigrationNative add, drop, rename, or replacement with existing-row validation.
Unnamed constraintsSupportedMatched semantically without depending on PostgreSQL-generated names.
Referenced-key alterationMigrationDependent foreign keys are dropped first and recreated after the referenced change.
Exclusion constraintUnsupportedUse an explicit reviewed migration.

Other schema objects

FeatureStatusPlanned behavior
SchemaCreate/dropDrops are destructive and use CASCADE.
ExtensionCreate/drop/recreateVersion changes can require destructive recreation.
IndexCreate/drop/recreateDefinition changes currently use destructive recreation.
ViewCreate/replace/dropChanges use CREATE OR REPLACE VIEW.
Function or procedureCreate/replace/dropChanges use CREATE OR REPLACE.
Enum, domain, or sequenceCreate/drop/recreateUnsupported in-place changes fall back to destructive recreation.
Table and column commentsSet/clearNative comment operations; requires AllowAlter.
Owners and privilegesNot modeledProject comparison flags are reserved; no owner or privilege operations are currently planned.

Permissions and failure behavior

  • AllowCreate controls new objects.
  • AllowAlter controls native changes, migrations, and replacements.
  • AllowDrop or --allow-drop controls destructive removals and recreations.
  • Disabled operations remain visible as commented blocked-* plan entries.
  • UseTransaction="true" rolls the complete apply back when conversion, dependency, uniqueness, foreign-key, or check validation fails.
  • StopOnDataLossRisk is recorded but is not an additional enforcement gate.

See the safety model for authorization details.