prisma / prisma/orm

PostgreSQL Exclusion Constraints

Open
#17,514 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/has-stopgap topic: constraint topic: database-functionality topic: exclusion constraint topic: indexes topic: postgresql
Dominant language
TypeScript
Stars
47.6k
Forks
2.5k
Avg merge
21h 59m
Merged PRs (30d)
95

Description

PostgreSQL supports exclusion constraints:

CREATE TABLE circles (
    c circle,
    EXCLUDE USING gist (c WITH &&)
);

(Also described in our DataGuide)

Currently these are falsely introspected as Gist indexes, which leads to problems like https://github.com/prisma/prisma/issues/15173

Instead we should figure out how to represent them properly in Prisma Schema Language, and fix introspection and migration of them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PostgreSQL exclusion-constraints documentation and the related issue #15173, then trace Prisma Schema Language, introspection, and migration handling for these constraints. Done means exclusion constraints have an appropriate schema representation and are no longer falsely treated as GiST indexes during introspection or migration.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.