diff --git a/postgresql/config.go b/postgresql/config.go index 4e713555..82a5a9a5 100644 --- a/postgresql/config.go +++ b/postgresql/config.go @@ -277,6 +277,10 @@ func (c *Client) Connect() (*DBConnection, error) { } else { db, err = postgres.Open(context.Background(), dsn) } + + if err == nil { + err = db.Ping() + } if err != nil { errString := strings.Replace(err.Error(), c.config.Password, "XXXX", 2) return nil, fmt.Errorf("Error connecting to PostgreSQL server %s (scheme: %s): %s", c.config.Host, c.config.Scheme, errString)