GnoseedGnoseed
Databases · Flashcard

What does WITHOUT OVERLAPS do in a PostgreSQL 18 PRIMARY KEY declaration?

Why this is the answer

PRIMARY KEY (id, valid_period WITHOUT OVERLAPS) is a temporal key: the same id may appear many times as long as no two of its periods overlap, which is exactly the rule a history of states needs. The period column is a full part of the key rather than a payload, uniqueness is strengthened rather than dropped, and nothing about insert ordering is constrained.

Read more in the docs
Study in Gnoseed →