citusdata / citusdata/citus

Primary key creation fails with duplicate key violation even though there are no duplicate values

Open
#1,770 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

Steps to produce

- Created a local table t1(a int, b int);
- Insert 2 rows (1, 1), (1,2);
- Create distributed table
- Create primary key on column a, fails with duplicate error (a=1);
- Delete violating rows (delete from t1 where a = 1), now table is empty
- Create primary key on column a, fails with duplicate error (a=1);

I believe this is due to us preserving local values of a table although it is distributed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.