Skip to content

pg-delta: support PostgreSQL temporal constraints (WITHOUT OVERLAPS / PERIOD) #182

@avallete

Description

@avallete

Problem

PostgreSQL 18 introduces temporal constraints such as WITHOUT OVERLAPS and PERIOD. pg-delta does not appear to model or diff this metadata today, which can cause false "no change" results when constraints differ only by temporal semantics.

Current gaps

  • Temporal metadata is not extracted from catalog sources such as pg_constraint.
  • The table-constraint property schema does not include temporal fields, so exported/introspected state cannot represent temporal PK/FK accurately.
  • Constraint diffing compares scalar fields and column lists but not temporal metadata or an equivalent full rendered definition, so regular <-> temporal transitions may be treated as unchanged.
  • The integration test matrix does not currently cover PostgreSQL 18 temporal DDL.

Desired behavior

  • Safely extract and represent temporal constraint metadata in the constraint model.
  • Treat non-temporal <-> temporal changes as drop/recreate (or another explicit migration), not as a no-op.
  • Add PostgreSQL 18 integration coverage for temporal PK/FK roundtrips.

Suggested work

  1. Extend catalog extraction to read temporal metadata in a PG-version-safe way.
  2. Thread the new field through the table constraint model/schema.
  3. Update diffing so temporal vs non-temporal constraints are recognized as changes.
  4. Add PostgreSQL 18 to the relevant integration matrix and cover temporal primary key / foreign key roundtrips.

Metadata

Metadata

Labels

🐛 BugDefects, regressions, or unintended behavior that need fixing

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions