func NetworkAddress(host string, port uint16) (network, address string) {
	if strings.HasPrefix(host, "/") {
		network = "unix"
		address = filepath.Join(host, ".s.PGSQL.") + strconv.FormatInt(int64(port), 10)
	} else {
		network = "tcp"
		address = net.JoinHostPort(host, strconv.Itoa(int(port)))
	}
	return network, address
}
NetworkAddress converts a PostgreSQL host and port into network and address suitable for use with
net.Dial.
package pgconn
import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"math"
	"net"
	"net/url"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"time"
	"github.com/jackc/chunkreader/v2"
	"github.com/jackc/pgpassfile"
	"github.com/jackc/pgproto3/v2"
	"github.com/jackc/pgservicefile"
)
type AfterConnectFunc func(ctx context.Context, pgconn *PgConn) error
type ValidateConnectFunc func(ctx context.Context, pgconn *PgConn) error
type Config struct {
	Host           string  
	Port           uint16
	Database       string
	User           string
	Password       string
	TLSConfig      *tls.Config  
	ConnectTimeout time.Duration
	DialFunc       DialFunc    
	LookupFunc     LookupFunc  
	BuildFrontend  BuildFrontendFunc
	RuntimeParams  map[string]string  
	Fallbacks []*FallbackConfig
	ValidateConnect ValidateConnectFunc
	AfterConnect AfterConnectFunc
	OnNotice NoticeHandler
	OnNotification NotificationHandler
	createdByParseConfig bool  
}
func (c *Config) Copy() *Config {
	newConf := new(Config)
	*newConf = *c
	if newConf.TLSConfig != nil {
		newConf.TLSConfig = c.TLSConfig.Clone()
	}
	if newConf.RuntimeParams != nil {
		newConf.RuntimeParams = make(map[string]string, len(c.RuntimeParams))
		for k, v := range c.RuntimeParams {
			newConf.RuntimeParams[k] = v
		}
	}
	if newConf.Fallbacks != nil {
		newConf.Fallbacks = make([]*FallbackConfig, len(c.Fallbacks))
		for i, fallback := range c.Fallbacks {
			newFallback := new(FallbackConfig)
			*newFallback = *fallback
			if newFallback.TLSConfig != nil {
				newFallback.TLSConfig = fallback.TLSConfig.Clone()
			}
			newConf.Fallbacks[i] = newFallback
		}
	}
	return newConf
}
type FallbackConfig struct {
	Host      string  
	Port      uint16
	TLSConfig *tls.Config  
}