diff options
Diffstat (limited to 'vendor/github.com/jackc')
| -rw-r--r-- | vendor/github.com/jackc/pgconn/CHANGELOG.md | 6 | ||||
| -rw-r--r-- | vendor/github.com/jackc/pgconn/config.go | 6 | ||||
| -rw-r--r-- | vendor/github.com/jackc/pgconn/pgconn.go | 20 | 
3 files changed, 21 insertions, 11 deletions
| diff --git a/vendor/github.com/jackc/pgconn/CHANGELOG.md b/vendor/github.com/jackc/pgconn/CHANGELOG.md index 3550b437e..36dcdae9a 100644 --- a/vendor/github.com/jackc/pgconn/CHANGELOG.md +++ b/vendor/github.com/jackc/pgconn/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.14.1 (July 19, 2023) + +* Fix: Enable failover efforts when pg_hba.conf disallows non-ssl connections (Brandon Kauffman) +* Fix: connect_timeout is not obeyed for sslmode=allow|prefer (smaher-edb) +* Optimize redundant pgpass parsing in case password is explicitly set (Aleksandr Alekseev) +  # 1.14.0 (February 11, 2023)  * Fix: each connection attempt to new node gets own timeout (Nathan Giardina) diff --git a/vendor/github.com/jackc/pgconn/config.go b/vendor/github.com/jackc/pgconn/config.go index 4080f2c6a..36b74c4a3 100644 --- a/vendor/github.com/jackc/pgconn/config.go +++ b/vendor/github.com/jackc/pgconn/config.go @@ -366,9 +366,9 @@ func ParseConfigWithOptions(connString string, options ParseConfigOptions) (*Con  	config.TLSConfig = fallbacks[0].TLSConfig  	config.Fallbacks = fallbacks[1:] -	passfile, err := pgpassfile.ReadPassfile(settings["passfile"]) -	if err == nil { -		if config.Password == "" { +	if config.Password == "" { +		passfile, err := pgpassfile.ReadPassfile(settings["passfile"]) +		if err == nil {  			host := config.Host  			if network, _ := NetworkAddress(config.Host, config.Port); network == "unix" {  				host = "localhost" diff --git a/vendor/github.com/jackc/pgconn/pgconn.go b/vendor/github.com/jackc/pgconn/pgconn.go index 6601194ce..e53130306 100644 --- a/vendor/github.com/jackc/pgconn/pgconn.go +++ b/vendor/github.com/jackc/pgconn/pgconn.go @@ -156,12 +156,15 @@ func ConnectConfig(octx context.Context, config *Config) (pgConn *PgConn, err er  	foundBestServer := false  	var fallbackConfig *FallbackConfig -	for _, fc := range fallbackConfigs { +	for i, fc := range fallbackConfigs {  		// ConnectTimeout restricts the whole connection process.  		if config.ConnectTimeout != 0 { -			var cancel context.CancelFunc -			ctx, cancel = context.WithTimeout(octx, config.ConnectTimeout) -			defer cancel() +			// create new context first time or when previous host was different +			if i == 0 || (fallbackConfigs[i].Host != fallbackConfigs[i-1].Host) { +				var cancel context.CancelFunc +				ctx, cancel = context.WithTimeout(octx, config.ConnectTimeout) +				defer cancel() +			}  		} else {  			ctx = octx  		} @@ -176,7 +179,7 @@ func ConnectConfig(octx context.Context, config *Config) (pgConn *PgConn, err er  			const ERRCODE_INVALID_CATALOG_NAME = "3D000"                // db does not exist  			const ERRCODE_INSUFFICIENT_PRIVILEGE = "42501"              // missing connect privilege  			if pgerr.Code == ERRCODE_INVALID_PASSWORD || -				pgerr.Code == ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION || +				pgerr.Code == ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION && fc.TLSConfig != nil ||  				pgerr.Code == ERRCODE_INVALID_CATALOG_NAME ||  				pgerr.Code == ERRCODE_INSUFFICIENT_PRIVILEGE {  				break @@ -599,9 +602,10 @@ func (pgConn *PgConn) PID() uint32 {  // TxStatus returns the current TxStatus as reported by the server in the ReadyForQuery message.  //  // Possible return values: -//   'I' - idle / not in transaction -//   'T' - in a transaction -//   'E' - in a failed transaction +// +//	'I' - idle / not in transaction +//	'T' - in a transaction +//	'E' - in a failed transaction  //  // See https://www.postgresql.org/docs/current/protocol-message-formats.html.  func (pgConn *PgConn) TxStatus() byte { | 
