Catalog Error: The table does not exist in this database
DuckDB cannot find the named table, view or table function in the catalog of the database you are connected to.
- Exception
Catalog Error- 카테고리
- Catalog Error
의미
This is DuckDB's missing-object error. The binder looked up the name in the catalog and found nothing with it: no table, no view, no table function. For a missing table the message spells out Table with name X does not exist!. A missing table function reports Table Function with name X does not exist!.
Because DuckDB is often embedded, the usual cause is not a typo but the wrong database: the application opened a fresh in-memory database, the file path resolved relative to a different working directory, or the query ran on a connection that never created the schema. Lookups are case-insensitive even for names created in double quotes, so a table created as "V07Mixed" is found by SELECT * FROM v07mixed and SELECT * FROM "v07mixed".
일반적인 원인
- A misspelled table name. Casing does not matter, even for names created with double quotes.
- The query ran against a different database than you think, often a new in-memory one opened by default.
- A table function from an extension that is not loaded, such as
iceberg_scanwith autoloading disabled, does not bind. Built-in functions such asread_csv_autoneed no extension and fail with an IO error on a missing file, not a catalog error. - The migration that creates the table never ran on this connection.
Find the cause
-- What tables does this connection see, and from which file? SELECT database_name, schema_name, table_name, estimated_size FROM duckdb_tables(); SELECT database_name, path FROM duckdb_databases(); -- Search every catalog position of the name, including views and table functions: SELECT * FROM duckdb_tables() WHERE table_name ILIKE '%users%'; SELECT function_name FROM duckdb_functions() WHERE function_name ILIKE '%users%';
해결 방법
-
List what actually exists in the connected database before rewriting the query:
SELECT table_schema, table_name, table_type FROM information_schema.tables ORDER BY 1, 2;
-
Check which database file the connection opened. An empty catalog usually means the process opened a new or in-memory database:
SELECT current_database(), database_name, path FROM duckdb_databases();
-
Qualify the name if the table lives in another attached database:
SELECT * FROM backup.users LIMIT 5;
-
Create the table if it should exist, with IF NOT EXISTS so reruns are safe:
CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, email VARCHAR);
Other ways to handle it
If the table should exist, run the migration on this connection instead of working around it. If it should not, point the connection at the right file with an absolute path; relative paths are resolved against the process working directory, which is rarely what you expect in a service.
안전하게 재현하세요
SELECT * FROM no_such_table; -- Catalog Error: Table with name no_such_table does not exist!
질문
The table exists in my file. Why does DuckDB say it does not?
The connection is probably not on that file. Embedded apps often open an unnamed in-memory database by default, and a relative path may have resolved elsewhere. Run SELECT * FROM duckdb_databases() to see the path of what you are connected to.
Does capitalization matter?
Names are matched case-insensitively, including names created inside double quotes. A name created as "V07Mixed" is found by any casing, quoted or not.
관련 오류
Catalog ErrorThe table or object already existsBinder ErrorThe column is not in the FROM clauseIO ErrorA file could not be openedSQLITE_ERRORSQLite: SQL logic error42P01PostgreSQL: 릴레이션이 존재하지 않음1146MySQL: 테이블이 존재하지 않음
More catalog error errors
코드와 메시지 텍스트의 출처는 다음과 같습니다 DuckDB documentation. 전체 목록은 DuckDB error list 또는 모든 데이터베이스 오류 검색.
Work on DuckDB in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for DuckDB and the other databases you use.
이 페이지의 텍스트와 데이터: CC BY 4.0, 출처: SQLly (sqlly.app). 코드와 SQL 스니펫: MIT. 라이선스 세부 정보 인용된 오류 메시지 텍스트의 권리는 해당 데이터베이스 공급업체에 있습니다.