Skip to content

PostgreSQL constraints doc shows the default temporal constraint name with a double underscore #154

Closed

Description

@CaffeinatedCoder

Found in the 5.5.0 pre-tag gate probe (#36). This predates 5.5.0.

docs/postgresql-constraints.md, line 29, shows the default temporal constraint name as:

builder.HasTemporalConstraint(
    keyColumns: b => b.RoomId,
    period:     b => b.ValidPeriod);
// ALTER TABLE "Bookings" ADD CONSTRAINT "AK_Bookings__RoomId_ValidPeriod"

The differ builds the name as $"AK_{table}_{string.Join("_", keyColumns)}_{periodColumn}" (NpgsqlComplexIndexMigrationsModelDiffer.cs:1201). The name it actually produces is AK_Bookings_RoomId_ValidPeriod, with one underscore. On PostgreSQL 18 the gate probe's live run produced AK_role_grants_GranteeId_Period.

A consumer who copies the documented name, for example into a raw DROP CONSTRAINT, an IF EXISTS check or a test, targets a constraint that does not exist.

Fix: correct the comment to "AK_Bookings_RoomId_ValidPeriod", and check the composite-key sample below it the same way.

Activity

  1. added this to the 5.5.0 milestone on Oct 20, 2026
  2. added
    documentation
    package/postgresql
    area/constraints
    on Oct 20, 2026
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/constraintsdocumentationpackage/postgresql

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions