MP083WARNINGFree

warn-fk-nondeterministic-collation

What It Detects

FK on column with non-deterministic collation may fail on PG18+ or match incorrect values.

Why It's Dangerous

PostgreSQL 18 validates that FK columns use deterministic collations. Non-deterministic collations (like ICU case-insensitive) can cause FK lookups to match incorrect values. PG18 rejects such FKs.

Bad Example

CREATE TABLE orders (
  code TEXT COLLATE "und-x-icu",
  FOREIGN KEY (code) REFERENCES products(code)
);

Good Example

CREATE TABLE orders (
  code TEXT COLLATE "C",
  FOREIGN KEY (code) REFERENCES products(code)
);

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP083: false

Or change its severity:

# .migrationpilotrc.yml
rules:
  MP083:
    severity: warning