diff --git a/pgxpool/pool.go b/pgxpool/pool.go index 7f200622..516de53a 100644 --- a/pgxpool/pool.go +++ b/pgxpool/pool.go @@ -96,7 +96,7 @@ type Config struct { // AfterConnect is called after a connection is established, but before it is added to the pool. AfterConnect func(context.Context, *pgx.Conn) error - // BeforeAcquire is called before before a connection is acquired from the pool. It must return true to allow the + // BeforeAcquire is called before a connection is acquired from the pool. It must return true to allow the // acquision or false to indicate that the connection should be destroyed and a different connection should be // acquired. BeforeAcquire func(context.Context, *pgx.Conn) bool @@ -458,6 +458,7 @@ func (p *Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pg if err != nil { return errRow{err: err} } + defer c.Release() row := c.QueryRow(ctx, sql, args...) return c.getPoolRow(row)