Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A string literal in the query casted to CHARACTER, causing a SQL failure #122

Open
OndraZizka opened this issue Sep 3, 2023 · 0 comments

Comments

@OndraZizka
Copy link
Owner

Using a SQL with a string literal as the value fails:

SELECT NULL AS crunchCounter,  'This should appear on STDOUT' AS msg  FROM "eapBuilds"

DB error: SQLDataException data exception: string data, right truncation
Tables and column types:

  • eapBuilds_out
    • CRUNCHCOUNTER BIGINT
    • MSG CHARACTER

The cause is that the literal is reduced to the type CHARACTER, which is by default of length 1, so the string does not fit.

Fix: The CHARACTER needs to retain the determined length - e.g. CHARACTER(50) or so; or always changed to CHARACTER VARYING.

@OndraZizka OndraZizka added this to the Soon-ish milestone Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant