-
Notifications
You must be signed in to change notification settings - Fork 4.1k
pgwire: Add SEVERITY_NONLOCALIZED error field #81794
Copy link
Copy link
Closed
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-pgwirepgwire protocol issues.pgwire protocol issues.A-tools-psycopgC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-blathers-triagedblathers was able to find an ownerblathers was able to find an owner
Description
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
NoneDescribe 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:
cockroach/pkg/sql/pgwire/conn.go
Line 1475 in daf3b48
| msgBuilder.writeTerminatedString(pgErr.Severity) |
Jira issue: CRDB-16071
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-pgwirepgwire protocol issues.pgwire protocol issues.A-tools-psycopgC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-blathers-triagedblathers was able to find an ownerblathers was able to find an owner