Skip to content

Support WITHOUT OVERLAPS for primary keys and unique indexes on temporal tables #3708

Activity

  1. added this to the 11.0.0 milestone on Jan 23, 2026
  2. self-assigned this
    on Jan 23, 2026
  3. added theissue type on Jan 23, 2026
  4. roji commented on Jan 23, 2026

    @roji
    MemberAuthor

    WITHOUT OVERLAPS can only on a single column in the primary key, and only on the last. So we can effectively treat it as an option on the primary key, rather than on one of its columns.

    One slight issue is that if we do this, it's up to the user to make sure that they list the range column as the last column in the constraint definition.

    -- Works
    CREATE TABLE employees (
        emp_id INTEGER,
        emp_name VARCHAR(100) NOT NULL,
        valid_period tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
        PRIMARY KEY (emp_id, valid_period WITHOUT OVERLAPS)
    );
    
    -- Syntax error - not last
    CREATE TABLE employees (
        emp_id INTEGER,
        emp_name VARCHAR(100) NOT NULL,
        valid_period tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
        PRIMARY KEY (valid_period WITHOUT OVERLAPS, emp_id)
    );
    
    -- Syntax error - not last. Means also that you can have two WITHOUT OVERLAPS clauses
    CREATE TABLE employees (
        emp_id INTEGER,
        emp_name VARCHAR(100) NOT NULL,
        valid_period tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
        valid_period2 tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
        PRIMARY KEY (emp_id, valid_period WITHOUT OVERLAPS, valid_period2 WITHOUT OVERLAPS)
    );
  5. added a commit that references this issue on Jan 23, 2026
    0fadabd
  6. changed the title [-]Support WITHOUT OVERLAPS[/-] [+]Support WITHOUT OVERLAPS for primary keys and unique indexes on temporal tables[/+] on Jan 23, 2026
  7. added 3 commits that reference this issue on Jan 23, 2026
    686b792
    bf7fe95
    e185e78
  8. added a commit that references this issue on Jan 23, 2026
    789f55a
  9. marked Temporal table support #3836 as a duplicate of this issue on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions