diff --git a/pgconn/pgconn.go b/pgconn/pgconn.go index d5a67bea..32bc0f47 100644 --- a/pgconn/pgconn.go +++ b/pgconn/pgconn.go @@ -2117,7 +2117,8 @@ func (p *Pipeline) getResults() (results any, err error) { case *pgproto3.ParseComplete: peekedMsg, err := p.conn.peekMessage() if err != nil { - return nil, err + p.conn.asyncClose() + return nil, normalizeTimeoutError(p.ctx, err) } if _, ok := peekedMsg.(*pgproto3.ParameterDescription); ok { return p.getResultsPrepare()