duckdb / duckdb/duckdb-sqlite

information_schema.table_constraints and key_column_usage always list "memory" for table_catalog on attached databases - CONSTRAINTS are not then well export

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

Description

Working on an attached sqlite database :
```
con = duckdb.connect()

con.execute("ATTACH 'california_schools.sqlite' as cs (TYPE sqlite)")

con.execute("USE cs")

res = con.execute("SELECT * FROM information_schema.table_constraints").fetchall()

print(res)
```

Here an error occured adding to use information_schema on "memory" :
```
CatalogException Traceback (most recent call last)

Cell In[187], line 1

----> 1 res = con.execute("SELECT * FROM information_schema.table_constraints").fetchall()

2 print(res)

CatalogException: Catalog Error: Table with name table_constraints does not exist!

Did you mean "memory.information_schema.table_constraints"?

LINE 1: SELECT * FROM information_schema.table_constraints
```

When adding it and using it as requiered, the return list is empty whereas constraints keys well exist in database.

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.