Documentation
¶
Overview ¶
Package pgerr provides PostgreSQL error inspection helpers built on pgconn.PgError. SQLSTATE code constants are re-exported from github.com/jackc/pgerrcode — import that package directly if you need the full table of codes or class-membership helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrorNoRows ¶
IsErrorNoRows reports whether err is or wraps pgx.ErrNoRows or sql.ErrNoRows.
func IsFatal ¶
IsFatal reports whether err is a Postgres error that should be treated as fatal for retry/alerting purposes. SQLSTATE classes 00 (success), 01 (warning), 02 (no data), and 23 (integrity constraint violation) are non-fatal; every other class is fatal. Non-PgError errors return false (no opinion).
func IsUniqueViolation ¶
IsUniqueViolation reports whether err is a Postgres unique constraint violation (SQLSTATE 23505). When true, the returned string is the constraint name reported by the server (empty if the driver did not surface it).
Types ¶
This section is empty.