Skip to content

pgwire: Add SEVERITY_NONLOCALIZED error field #81794

Closed
@dvarrazzo

Description

@dvarrazzo

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

Metadata

Metadata

Assignees

Labels

A-sql-pgcompatSemantic compatibility with PostgreSQLA-sql-pgwirepgwire protocol issues.A-tools-psycopgC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)X-blathers-triagedblathers was able to find an owner

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions