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
{{ message }}
Repository navigation
how to understand what kind of error returned by Query #2587
Hi!, i'm using pgx with yandex ha-sql library and create something like automatic retry for failed statements (internally all my queries are idempotent).
But for some reasons error may not mean network error, or postgresql server error like conflict with recovery.
So does it possible to understand what error belongs to group and retry only needed group of errors (not i have ugly thing like check for context errors and some network errors)
So does it possible to understand what error belongs to group and retry only needed group of errors (not i have ugly thing like check for context errors and some network errors)
The closest thing pgx has is pgconn.SafeToRetry. But that is stricter than you need. Since pgx doesn't know if your query was read only or not it only considers an error safe to retry if it is sure the server did not receive it.
But beyond that I think you would need to specify which error categories are acceptable to retry.
Activity
jackc commentedon Jun 29, 2026
The closest thing pgx has is pgconn.SafeToRetry. But that is stricter than you need. Since pgx doesn't know if your query was read only or not it only considers an error safe to retry if it is sure the server did not receive it.
But beyond that I think you would need to specify which error categories are acceptable to retry.