Binder Error: DuckDB could not plan the query
DuckDB parsed the query but couldn't plan it: a missing column, an alias out of scope, or types that don't fit the function. A missing table raises Catalog Error instead.
- Exception
Binder Error- Category
- Binder Error
What it means
Binder Error means the parser accepted the SQL but the binder could not resolve it against the catalog and the types. This is the class for the most common day-to-day mistakes: a column or table that does not exist, a function called with argument types that have no overload, or a struct key that is not there. DuckDB binds each statement before running it, so a bind error means that statement did not run. Statements earlier in the same script have already run.
The message says exactly which name, column or function signature failed. When the same SQL works elsewhere, compare the schema and the DuckDB version, because different builds ship different function overloads and extensions.
Common causes
- A column name that does not exist in the FROM clause, or a table alias used outside its scope.
- A function called with argument types that match no overload, such as
1 + 'a'oravg(text_column). - A struct or union key that is not present, for example
{'a': 1}.b. - A call to a function from an extension that is not loaded. DuckDB reports that as Catalog Error, not Binder Error.
Find the cause
-- The message names the column, function or key that failed. Check what the connection can actually see: SELECT table_schema, table_name FROM information_schema.tables ORDER BY 1; DESCRIBE my_table; -- Which overloads exist for the function you called: SELECT function_name, parameter_types, return_type FROM duckdb_functions() WHERE function_name = 'substring'; SELECT version();
How to fix it
-
Check the names the message mentions against the actual schema before changing the SQL:
DESCRIBE my_table; SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE table_name = 'my_table';
-
Add explicit casts when the binder cannot pick an overload, so the operation is unambiguous:
SELECT int_col + CAST(text_col AS INTEGER) FROM my_table;
-
List the functions that do exist when a name fails. Some names are aliases with the same signatures, such as
group_concatandstring_agg:SELECT function_name, parameter_types FROM duckdb_functions() WHERE function_name ILIKE '%agg%';
-
Load the extension a function belongs to when the name is unknown on this connection:
LOAD httpfs;
Other ways to handle it
If the column is genuinely missing, add it with ALTER TABLE rather than editing the query to fit the old schema. If the types are ambiguous, a cast in the query is better than relying on implicit conversion, which DuckDB keeps strict on purpose.
Reproduce it safely
SELECT 1 + 'a'; -- Binder Error: Could not choose a best candidate function for the function call "+(INTEGER_LITERAL, STRING_LITERAL)". In order to select one, please add explicit type casts.
Questions
Binder Error or Catalog Error: which one means a missing table?
A table that does not exist gives Catalog Error. A table that exists but lacks the column you named gives Binder Error.
Why does the same query work in another tool?
The other tool may run a different DuckDB version or have extensions loaded. Check version() and duckdb_extensions() on both connections.
Related errors
Binder ErrorThe column is not in the FROM clauseConversion ErrorThe value cannot be cast to the target typeCatalog ErrorThe table does not exist in this databaseParser ErrorThe SQL does not parseSQLITE_ERRORSQLite: SQL logic error42703PostgreSQL: column does not exist
The code and message text are from the DuckDB documentation. Browse the full DuckDB error list or search every database error.
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.
Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details Quoted error message text belongs to its database vendor. View as Markdown