diff --git a/flow/connectors/postgres/validate.go b/flow/connectors/postgres/validate.go index 76b1a78a91..928fbc2d4d 100644 --- a/flow/connectors/postgres/validate.go +++ b/flow/connectors/postgres/validate.go @@ -153,7 +153,7 @@ func (c *PostgresConnector) CheckReplicationConnectivity(ctx context.Context) er return fmt.Errorf("failed to create replication connection: %v", err) } - defer conn.Close(ctx) + return conn.Close(ctx) return nil }