Skip to content

PgExclusion, second slice: btree_gist is injected where an element needs it #78

Closed

Description

@CaffeinatedCoder

Second slice of #25, on top of #76. An exclusion constraint with an = element on a scalar column needs btree_gist; today the model has to declare the extension itself, and without it the migration fails at apply ("data type integer has no default operator class for access method gist").

Change

  • Kernel: SchemaResolver.StoreType(path), a column's store type, alike on a model and its snapshot. The planner acts on Dependency.Extension: one statement per extension that a created object depends on, ahead of everything else, written by the dialect (ISchemaDialect.EnsureExtension). The kernel's own dialect refuses: a provider without a SchemaKit package has no extensions.
  • PostgreSQL: the constraint lists btree_gist when an element needs it, by 5.x's rule (a column by its store type, an expression by its operator). The dialect writes CREATE EXTENSION IF NOT EXISTS, and nothing when the model declares the extension with HasPostgresExtension or calls modelBuilder.SuppressBtreeGistInjection() (5.x's annotation, CustomTemporal:SuppressAutoExtension).

Done when

On PostgreSQL 16 and 18 a model that declares the scheduling constraint and no extension applies through every path; the statement appears once per migration; a column whose type changes does not rebuild the constraint for it.

Activity

  1. added this to the 11.0.0 milestone on Nov 12, 2026
  2. added
    enhancement
    package/core
    package/postgresql
    area/constraints
    on Nov 12, 2026
  3. added a commit that references this issue on Nov 12, 2026
    18877be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/constraintsenhancementpackage/corepackage/postgresql

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions