You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An exclusion constraint declared on a derived type of a shared table covers its siblings' rows #82
area/constraintsExclusion constraints, row guards and other constraint-like objectsbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)package/postgresqlAffects CodoMetis.EFCore.SchemaKit.PostgreSQLseverity/mediumInconsistency or failure in a narrow scenario
Decided 2026-11-12 by the maintainer: refuse it (option 1), on the target side of a diff only. PR #86. What it costs is #85.
Found by the analysis of #77 and #79, reproduced on PostgreSQL 16.15 and 18.6.
What happens
Stay and Hold derive from Reservation in one table. DeclarePostgres on Stay alone gives ALTER TABLE reservations ADD CONSTRAINT ex_stay EXCLUDE USING gist ("RoomId" WITH =, "Period" WITH &&): no discriminator in it. Two overlapping Hold rows are refused with 23P01.
The database refuses writes the model allows. Neither the design nor the plan says what a declaration on a derived type of a shared table means.
To decide
Refuse a declaration on a derived type that shares its table, naming the base type to declare it on.
Add the discriminator to the condition, so that the constraint covers the derived type's rows.
The same question will come for PgIndex (#27), and the answer should be one.
area/constraintsExclusion constraints, row guards and other constraint-like objectsbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)package/postgresqlAffects CodoMetis.EFCore.SchemaKit.PostgreSQLseverity/mediumInconsistency or failure in a narrow scenario
Activity