Commit b09ef6f
authored
Bump github.com/lib/pq from 1.10.9 to 1.12.3 (#1349)
lib/pq was pinned at v1.10.9, which was 3 years and 6 releases behind
the latest tag (v1.11.0, v1.11.1, v1.11.2, v1.12.0, v1.12.1, v1.12.3).
Notably, v1.11.0 added support for the target_session_attrs DSN
parameter, which is needed to route connections to a primary/standby
correctly and was the specific ask in #1344.
The only usages of lib/pq in this repo were pq.ParseURL
(exporter/util.go, in parseFingerprint) and pq.Array
(collector/pg_process_idle.go, exporter/namespace.go). pq.ParseURL was
marked deprecated in this range (SA1019), which is the exact breakage
reported in #1284 ("Fix fingerprint generator for new lib/pq").
Rather than suppressing the lint warning, parseFingerprint was
reworked to stop depending on pq.ParseURL: it now uses net/url
directly to pull host/port out of postgres:// and postgresql:// DSNs,
falling back to the existing key=value parser for non-URL DSNs. This
removes the dependency on pq.ParseURL entirely and drops the lib/pq
import from util.go. Behavior is unchanged, verified against the
existing parseFingerprint test cases (URL DSNs, percent-encoded
passwords, key=value DSNs, and the malformed-DSN error path).
pq.Array is unaffected by the bump.
Go version and PostgreSQL version requirements introduced by v1.11.0
(Go 1.21+, PostgreSQL 14+ "supported") are already satisfied by this
module (go 1.25) and CI's oldest tested version (13.22), respectively,
though PG13 is technically past lib/pq's new support window.
Verified with `go build ./...`, `go vet ./...`, `go test ./...`,
golangci-lint (0 issues), govulncheck (0 vulnerabilities), and the
full integration suite (`-tags integration`) against live postgres:13
and postgres:16 Docker containers.
Fixes #1344.
Fixes #1284.
Signed-off-by: Raj <rajeshrajendirandev@gmail.com>1 parent cf8ccc6 commit b09ef6f
3 files changed
Lines changed: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
169 | 184 | | |
170 | 185 | | |
171 | 186 | | |
| |||
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
178 | | - | |
179 | 193 | | |
180 | 194 | | |
181 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments