OriginChainDB
Errors

400 - unknown column

← Errors examples

What happened

The table exists, but the request names a column that its schema does not define.

Resolve a column name before queryingDo not create a new column merely to hide a spelling mistake.
  1. Check the query nameInspect the column spelling and table alias.
  2. Read the table schemaConfirm which columns actually exist.
  3. Run the corrected queryUse the intended column and inspect the returned fields.

Request that triggers it

Selecting a column that isn't in the schema.

curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \
  -H "Authorization: Bearer $OC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sql": "SELECT bogus_col FROM shop.customers LIMIT 1"}'

Read the response

{
  "error": "unknown_column",
  "message": "column 'bogus_col' is not declared on table 'shop.customers'",
  "retry": false
}

Fix the request

  1. Check the column spelling and case.
  2. Read the table schema.
  3. Qualify columns with the right alias in joins.
  4. Correct the query or explicitly update the intended schema.

Keep in mind: Do not create a new column just to hide a typo in an existing query.

Common causes

  • Typo in the column name.
  • SQL written against a newer schema version than the one currently registered.
  • Aliasing in a JOIN where the alias scope was lost.
  • SELECT * works, then a specific column was added - check spelling against the manifest.
  • Confusing a JSON sub-field with a top-level column (sub-fields require json_extract(...)).

Continue

See error handling and retries, or return to error examples.

© 2026 Silicoyn Technologies Pvt Ltd

On this page