Error 60: UNKNOWN_TABLE
This error occurs when a query references a table that does not exist in the specified database. It indicates that ClickHouse cannot find the table you're trying to access, either because it was never created, has been dropped, or you're referencing the wrong database.
Most common causes
-
Table name typo
- Misspelled table name
- Incorrect capitalization (table names are case-sensitive)
- Extra or missing characters in table name
-
Wrong database context
- Querying a table in the wrong database
- Database parameter not set correctly
- Using table name without database prefix when not in the correct database context
-
Table was dropped or renamed
- Table was deleted by another process
- Table was renamed and old name is still being used
- Temporary tables that have expired
-
Incorrect database/table specification in connection
- HTTP interface with wrong
databaseparameter - Wrong
X-ClickHouse-Databaseheader - JDBC/ODBC connection string with incorrect database
- HTTP interface with wrong
-
Client or ORM confusion
- Client libraries using table name as database name
- ORM frameworks misinterpreting table references
- Query builders constructing incorrect table paths
-
Distributed table or cluster issues
- Local table missing on some cluster nodes
- Distributed table pointing to non-existent local tables
- Replication lag causing temporary table unavailability
Common solutions
1. Verify the table exists
2. Use fully qualified table names
3. Check current database context
4. Verify HTTP interface database parameter
5. Check for distributed table issues
6. Look for similar table names
Newer ClickHouse versions suggest similar table names:
Common scenarios
Scenario 1: Client using table name as database name
Cause: HTTP client or ORM incorrectly passing table name as database parameter.
Solution: Check connection parameters and ensure database parameter contains the database name, not table name.
Scenario 2: Missing distributed local tables
Cause: Distributed table configured but local tables don't exist on some cluster nodes.
Solution:
Scenario 3: Temporary table expired
Cause: Temporary table was created by a process that has ended, or it expired.
Solution: Recreate the temporary table or check the process that creates it.
Scenario 4: Wrong database context
But table exists in production database.
Solution:
Scenario 5: Integration table disappeared
Cause: Source table in external system (PostgreSQL/MySQL) was dropped.
Solution: Verify source table exists in source system and recreate ClickHouse integration if needed.
Prevention tips
- Always use fully qualified names: Use
database.tablesyntax in production code - Verify table existence before queries: Use
IF EXISTSchecks in scripts - Set database context explicitly: Don't rely on default database
- Use table existence checks: Especially in automated processes
- Monitor table changes: Track table creation/deletion events
- Document table dependencies: Especially for distributed setups
Debugging steps
-
List all available tables:
-
Search for table across databases:
-
Check current database:
-
Verify connection parameters:
- Check HTTP
databaseparameter - Verify
X-ClickHouse-Databaseheader - Review JDBC/ODBC connection string
- Check HTTP
-
For distributed tables, check cluster:
-
Check recent table operations:
Special considerations
For HTTP interface users:
- The
databaseparameter specifies which database to use - This is NOT the table name
- Common issue with ORMs and query builders
For distributed tables:
- The distributed table must exist
- Local tables must exist on all cluster nodes
- Use
ON CLUSTERclause when creating tables
For temporary tables:
- Temporary tables are session-specific
- They disappear when the session ends
- Named with timestamps are often temp tables
For integrations (MySQL/PostgreSQL):
- Verify source table exists in source system
- Check connection to source system
- Review materialized view or integration configuration
If you're experiencing this error:
- Double-check the table name for typos
- Verify you're querying the correct database
- Use fully qualified table names (
database.table) - Check connection parameters (especially for HTTP interface)
- Verify the table actually exists using
SHOW TABLES - For distributed setups, check all cluster nodes