cockroachdb / cockroachdb/cockroach

Support `NULLS NOT DISTINCT`

Open
#115,836 1 comment 3 reactions 0 assignees View on GitHub
A-sql-pgcompat C-enhancement O-community T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

[Postgres 15 release](https://www.postgresql.org/docs/15/release-15.html) added support for `NULLS NOT DISTINCT`.

For instance:
```
CREATE TABLE IF NOT EXISTS usage_tracking4 (
a INT PRIMARY KEY,
b INT,

UNIQUE NULLS NOT DISTINCT (a, b)
);
```

this currently fails because of a syntax error, but works fine on Postgres proper.

I tried to see if there was an on-going FR for this, but did not find it.

Jira issue: CRDB-34239

Epic CRDB-60817

Contributor guide

Open the contributing guide

Research direction

Use the PostgreSQL 15 release note and the supplied CREATE TABLE example as the behavioral reference. Locate CockroachDB's CREATE TABLE and UNIQUE-constraint syntax handling, add coverage for UNIQUE NULLS NOT DISTINCT, and verify the example no longer raises a syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.