diff --git a/go.mod b/go.mod index b1a47822..2024dc9d 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( code.cloudfoundry.org/runtimeschema v0.0.0-20240514235758-31be7684c5bf code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e github.com/cloudfoundry/dropsonde v1.1.0 - github.com/lib/pq v1.11.1 + github.com/lib/pq v1.11.2 github.com/onsi/ginkgo/v2 v2.28.1 github.com/onsi/gomega v1.39.1 github.com/tedsuo/ifrit v0.0.0-20230516164442-7862c310ad26 diff --git a/go.sum b/go.sum index bb7ba031..f3dce9a6 100644 --- a/go.sum +++ b/go.sum @@ -884,8 +884,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.11.1 h1:wuChtj2hfsGmmx3nf1m7xC2XpK6OtelS2shMY+bGMtI= -github.com/lib/pq v1.11.1/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= +github.com/lib/pq v1.11.2 h1:x6gxUeu39V0BHZiugWe8LXZYZ+Utk7hSJGThs8sdzfs= +github.com/lib/pq v1.11.2/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= diff --git a/vendor/github.com/lib/pq/CHANGELOG.md b/vendor/github.com/lib/pq/CHANGELOG.md index 338b128b..2fce02d2 100644 --- a/vendor/github.com/lib/pq/CHANGELOG.md +++ b/vendor/github.com/lib/pq/CHANGELOG.md @@ -1,3 +1,17 @@ +v1.11.2 (2025-02-10) +-------------------- +This fixes two regressions: + +- Don't send startup parameters if there is no value, improving compatibility + with Supavisor ([#1260]). + +- Don't send `dbname` as a startup parameter if `database=[..]` is used in the + connection string. It's recommended to use dbname=, as database= is not a + libpq option, and only worked by accident previously. ([#1261]) + +[#1260]: https://github.com/lib/pq/pull/1260 +[#1261]: https://github.com/lib/pq/pull/1261 + v1.11.1 (2025-01-29) -------------------- This fixes two regressions present in the v1.11.0 release: diff --git a/vendor/github.com/lib/pq/conn.go b/vendor/github.com/lib/pq/conn.go index 5e7ce20d..9e69b473 100644 --- a/vendor/github.com/lib/pq/conn.go +++ b/vendor/github.com/lib/pq/conn.go @@ -1188,20 +1188,27 @@ func (cn *conn) startup(cfg Config) error { w := cn.writeBuf(0) w.int32(proto.ProtocolVersion30) - w.string("user") - w.string(cfg.User) - w.string("database") - w.string(cfg.Database) + if cfg.User != "" { + w.string("user") + w.string(cfg.User) + } + if cfg.Database != "" { + w.string("database") + w.string(cfg.Database) + } // w.string("replication") // Sent by libpq, but we don't support that. - w.string("options") - w.string(cfg.Options) + if cfg.Options != "" { + w.string("options") + w.string(cfg.Options) + } if cfg.ApplicationName != "" { w.string("application_name") w.string(cfg.ApplicationName) } - w.string("client_encoding") - w.string(cfg.ClientEncoding) - + if cfg.ClientEncoding != "" { + w.string("client_encoding") + w.string(cfg.ClientEncoding) + } for k, v := range cfg.Runtime { w.string(k) w.string(v) diff --git a/vendor/github.com/lib/pq/connector.go b/vendor/github.com/lib/pq/connector.go index 4c318662..1827fdbd 100644 --- a/vendor/github.com/lib/pq/connector.go +++ b/vendor/github.com/lib/pq/connector.go @@ -758,14 +758,12 @@ func (cfg *Config) setFromTag(o map[string]string, tag string) error { // Set run-time; we delete map keys as they're set in the struct. if tag == "postgres" { - // Make sure database= sets dbname=; in startup() we send database for - // dbname, and if we have both set it's inconsistent as the loop order - // is a map. + // Make sure database= sets dbname=, as that previously worked (kind of + // by accident). + // TODO(v2): remove if d, ok := o["database"]; ok { + cfg.Database = d delete(o, "database") - if o["dbname"] == "" { - o["dbname"] = d - } } cfg.Runtime = o } diff --git a/vendor/modules.txt b/vendor/modules.txt index 53b26c79..b4102711 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -119,7 +119,7 @@ github.com/google/pprof/profile # github.com/josharian/intern v1.0.0 ## explicit; go 1.5 github.com/josharian/intern -# github.com/lib/pq v1.11.1 +# github.com/lib/pq v1.11.2 ## explicit; go 1.21 github.com/lib/pq github.com/lib/pq/internal/pgpass