You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: connection.go
    path of file: ./repos/kuma/pkg/plugins/common/postgres
    
    the code of the file until where you have to start completion: package postgres

import (
	"context"
	"database/sql"
	"math"
	"time"

	"github.com/exaring/otelpgx"
	"github.com/jackc/pgx/v5/pgxpool"
	"github.com/pkg/errors"
	"go.opentelemetry.io/otel/attribute"

	config "github.com/kumahq/kuma/pkg/config/plugins/resources/postgres"
	pgx_config "github.com/kumahq/ku
    
func ConnectToDbPgx(postgresStoreConfig config.PostgresStoreConfig, customizers ...pgx_config.PgxConfigCustomization) (*pgxpool.Pool, error) {
	connectionString, err := postgresStoreConfig.ConnectionString()
	if err != nil {
		return nil, err
	}
	pgxConfig, err := pgxpool.ParseConfig(connectionString)

	if postgresStoreConfig.MaxOpenConnections == 0 {
		// pgx MaxCons must be > 0, see https://github.com/jackc/puddle/blob/c5402ce53663d3c6481ea83c2912c339aeb94adc/pool.go#L160
		// so unlimited is just max int
		pgxConfig.MaxConns = math.MaxInt32
	} else {
		pgxConfig.MaxConns = int32(postgresStoreConfig.MaxOpenConnections)
	}
	pgxConfig.MinConns = int32(postgresStoreConfig.MinOpenConnections)
	pgxConfig.MaxConnIdleTime = time.Duration(postgresStoreConfig.ConnectionTimeout) * time.Second
	pgxConfig.MaxConnLifetime = postgresStoreConfig.MaxConnectionLifetime.Duration
	pgxConfig.MaxConnLifetimeJitter = postgresStoreConfig.MaxConnectionLifetime.Duration
	pgxConfig.HealthCheckPeriod = postgresStoreConfig.HealthCheckInterval.Duration
	pgxConfig.ConnConfig.Tracer = otelpgx.NewTracer(otelpgx.WithAttributes(spanTypeSQLAttribute))
	for _, customizer := range customizers {
		customizer.Customize(pgxConfig)
	}

	if err != nil {
		return nil, err
	}

	return pgxpool.NewWithConfig(context.Background(), pgxConfig)
}