duckdb / duckdb/duckdb-sqlite

sqlite: cannot reference table due to type mismatch

Open
#102 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
291
Forks
45
Avg merge
10h 13m
Merged PRs (30d)
18

Description

### What happens?

Hi everyone,
I attach an sqlite in-memory database

I create two tables, the second one references the first one

I get this error

Binder Error: Failed to create foreign key: incompatible types between column "id" ("BIGINT") and column "t1_id" ("INTEGER")

### To Reproduce

INSTALL sqlite;
LOAD sqlite;
ATTACH ':memory:' AS db2 (TYPE SQLITE);

use db2;

create table t1 (
id integer primary key,
name varchar
);

create table t2(
id integer primary key,
t1_id integer references t1(id)
);

### OS:

macos

### SQLite Version:

3.46.0

### DuckDB Version:

v0.10.3

### DuckDB Client:

cli

### Affiliation:

no affiliation

### Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

- [X] I agree

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.