// PgErr returns a *pgconn.PgError or nil if there are no PgErrors in the error
// chain.
PgErr returns a *pgconn.PgError or nil if there are no PgErrors in the error
chain.
// PgErr returns a * pgconn . PgError or nil if there are no PgErrors in the error // chain .
func PgErr(err error) *pgconn.PgError {
	var e *pgconn.PgError
	if errors.As(err, &e) {
		return e
	}
	return nil
}
func PgErr ( err error ) * pgconn . PgError { var e * pgconn . PgError if errors . As ( err , & e ) { return e } return nil }
PgErr returns a *pgconn.PgError or nil if there are no PgErrors in the error
chain.
PgErr returns a * pgconn . PgError or nil if there are no PgErrors in the error chain .