You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It comes from PQresultErrorField, if I understand correctly your question? It is read from the libpq error here and attached in this function to the Error object.
Yes, it comes from the libpq. The libpq receives it from the server, as part of its response. I don't know if there is any error that the libpq generates itself client-side and to which it attached a SQLSTATE code, I've never checked. Psycopg never does it: if a code is exposed there it means it came from the libpq.
In the C libs, I'm trying to figure out where the SQLSTATE code is updated from (which then maps to Postgresql errors and gives it to python).
If anyone could explain to me where that value comes from initially that'd be really appreciated.
I know that in
pq_raise(...)
, eitherpgres
orcurs
should have it, but I can't seem to trace these further.The text was updated successfully, but these errors were encountered: