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

ERROR: trailing junk after numeric literal at or near "0H" Position: 154 #727

Open
kdhrubo opened this issue Oct 5, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@kdhrubo
Copy link
Collaborator

kdhrubo commented Oct 5, 2024

The following query

SELECT t_re_33."id" ,t_re_33."name" ,t_re_33."display_name" ,t_re_33."deleted" ,t_re_33."display_order" ,t_re_33."storage_provider_id" FROM 0HEM8B0GQNB5M.t_region t_re_33

Leads to error Caused by: org.postgresql.util.PSQLException: ERROR: trailing junk after numeric literal at or near "0H" Position: 154

Solution : cover the schema name in quotes.

@kdhrubo kdhrubo added the bug Something isn't working label Oct 5, 2024
@thadguidry
Copy link
Collaborator

thadguidry commented Oct 5, 2024

But I already said this: Best to always use quoted identifiers. See https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

  1. Quoted identifiers can contain any character except char(0).
  2. Maximum length of any identifier is 63 characters.
  3. And escaping, well for PostgreSQL, it ends up being entirely dependent on what the admin has configured the server encoding to (UTF-8, or not, etc.)

@thadguidry
Copy link
Collaborator

SELECT "t_re_33"."id",
       "t_re_33"."name",
       "t_re_33"."display_name",
       "t_re_33"."deleted",
       "t_re_33"."display_order",
       "t_re_33"."storage_provider_id"
FROM "0HEM8B0GQNB5M"."t_region" "t_re_33";

@kdhrubo
Copy link
Collaborator Author

kdhrubo commented Oct 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants