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
A 5.x snapshot with an empty exclusion list on a TPC root is refused as holding constraints #171
area/constraintsExclusion constraints, row guards and other constraint-like objectsbugSomething isn't workingpackage/postgresqlAffects CodoMetis.EFCore.SchemaKit.PostgreSQLseverity/lowCosmetic, message or documentation-level difference
Found by the pre-tag review of 948496a..0ee827d (the review for v11.0.0-preview.1). The file itself is not in that range.
ComplexIndexes5xExclusionReader (src/CodoMetis.EFCore.SchemaKit.PostgreSQL/Legacy/Internal/ComplexIndexes5xExclusionReader.cs:46-55) refuses a TPC root before it parses the list. A snapshot whose CustomExclusion:Constraints on the root of a TPC hierarchy is "[]" is refused with "holds exclusion constraints from EFCore.ComplexIndexes 5.x on Vehicle, the root of a TPC hierarchy", although it holds none. The kernel's own guard treats "[]" as nothing (LegacyFormats.HoldsSomething), as it treats "", and the reader accepts "".
Reproduction (test/…PostgreSQL.Tests/Legacy/, on 0ee827d): LegacyFixture.DiffFrom<MovedModels.SlotAlone> from a source with Entity<Vehicle>().UseTpcMappingStrategy().HasAnnotation("CustomExclusion:Constraints", json) passes for "" and throws for "[]".
No published 5.x writes "[]" for this annotation, as far as its source shows: NpgsqlExclusionMutableExtensions rewrites the list only when it amended an entry, and there is no removal. So only a snapshot edited by hand reaches it, and the failure is loud.
Fix: check for a TPC root only once the list is known to hold an entry, as HoldsSomething does.
Does it block preview.1?
No. It needs a hand-edited snapshot, and it refuses rather than misreading.
2026-11-25: fixed on the branch fix/172-171-tidy. The reader looks at the mapping strategy only once the list holds an entry. Since #189 the refusal was for a snapshot from before 5.5.0 alone; an empty list is read as no constraint in a snapshot of any version. A_constraint_on_the_root_of_a_TPC_hierarchy_is_read_from_the_version_that_made_copies holds "[]" and "", and fails with the check for an empty list taken out.
area/constraintsExclusion constraints, row guards and other constraint-like objectsbugSomething isn't workingpackage/postgresqlAffects CodoMetis.EFCore.SchemaKit.PostgreSQLseverity/lowCosmetic, message or documentation-level difference
Activity
CaffeinatedCoder commentedon Nov 25, 2026
2026-11-25: fixed on the branch
fix/172-171-tidy. The reader looks at the mapping strategy only once the list holds an entry. Since #189 the refusal was for a snapshot from before 5.5.0 alone; an empty list is read as no constraint in a snapshot of any version.A_constraint_on_the_root_of_a_TPC_hierarchy_is_read_from_the_version_that_made_copiesholds"[]"and"", and fails with the check for an empty list taken out.