INTERNAL error when creating an index conflicting with an internal index name
Author: dentinyCreated Sep 10, 2026Updated Sep 29, 2026
LabelsPR submitted
What happens?
Hi team, I found when I create an index with the index name same as an internal index (i.e., primary key, unique constraint, foreign key, etc), the index creation seems to go through and crashes sometimes. See repro for details.
To Reproduce
memory D CREATE TABLE p(id INTEGER PRIMARY KEY);
memory D CREATE TABLE c(id INTEGER, FOREIGN KEY (id) REFERENCES p(id));
memory D INSERT INTO p VALUES (1);
memory D INSERT INTO c VALUES (1);
memory D CREATE INDEX IF NOT EXISTS FOREIGN_c_0 ON c(id);
memory D DROP INDEX FOREIGN_c_0;
memory D DELETE FROM p WHERE id = 1;
INTERNAL Error:
TableIndexList::VerifyForeignKey failed to find foreign key indexOS:
macos
DuckDB Version:
6ee2305dc786e2429c85eb971f8854f5a9807149
DuckDB Client:
SQL
Hardware:
No response
Full Name:
dentiny
Affiliation:
N/A
Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?
- Yes, I have
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant data sets for reproducing the issue?
Yes
Source: duckdb/duckdb