U127: Column cannot be cast to type
SQLSTATE: 42804 (Class 42 — Syntax Error or Access Rule Violation: datatype_mismatch)
Example Postgres Log Output:
ERROR: column "abc" cannot be cast to type "date" STATEMENT: SELECT abc::date FROM x
Your query is trying to cast the referenced column to a data type that is not supported for the original data type.
Usually this would occur when you assume the original data type is something different from what it actually is.
Fix the query to either use a different target type, or adjust the source column to have the correct type.
In some cases you may also need multiple type casts to get your desired result.
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →