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

pgwire: Add SEVERITY_NONLOCALIZED error field #81794

Closed
dvarrazzo opened this issue May 24, 2022 · 2 comments · Fixed by #82677
Closed

pgwire: Add SEVERITY_NONLOCALIZED error field #81794

dvarrazzo opened this issue May 24, 2022 · 2 comments · Fixed by #82677
Assignees
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-pgwire pgwire protocol issues. A-tools-psycopg C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-community Originated from the community T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner

Comments

@dvarrazzo
Copy link

dvarrazzo commented May 24, 2022

Is your feature request related to a problem? Please describe.

Since version 9.6, PostgreSQL emits a SEVERITY_NONLOCALIZED field with its error messages (code is V). This field is missing in CRDB.

>>> import psycopg
>>> conn = psycopg.connect("postgresql://root@localhost:26257/defaultdb?sslmode=disable")
>>> try:
...     conn.execute("select wat")
... except Exception as e:
...     ex = e

>>> ex.diag.severity
'ERROR'  # This might be in another language

>>> ex.diag.severity_nonlocalized
None

Describe the solution you'd like

Please introduce this field, as it might be used by clients to decide what to do with a notification.

It needs to be added here:

msgBuilder.writeTerminatedString(pgErr.Severity)

Jira issue: CRDB-16071

@dvarrazzo dvarrazzo added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label May 24, 2022
@blathers-crl
Copy link

blathers-crl bot commented May 24, 2022

Hello, I am Blathers. I am here to help you get the issue triaged.

I have CC'd a few people who may be able to assist you:

  • @cockroachdb/sql-experience (found keywords: libpq)
  • @cockroachdb/bulk-io (found keywords: import)

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added A-disaster-recovery O-community Originated from the community X-blathers-triaged blathers was able to find an owner T-disaster-recovery labels May 24, 2022
@blathers-crl
Copy link

blathers-crl bot commented May 24, 2022

cc @cockroachdb/bulk-io

@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 24, 2022
@rafiss rafiss added A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-pgwire pgwire protocol issues. A-tools-psycopg and removed A-disaster-recovery labels May 24, 2022
@rafiss rafiss changed the title Add SEVERITY_NONLOCALIZED error field pgwire: Add SEVERITY_NONLOCALIZED error field Jun 2, 2022
@craig craig bot closed this as completed in 0e5927a Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-pgwire pgwire protocol issues. A-tools-psycopg C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-community Originated from the community T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants