Treat io.ErrUnexpectedEOF as driver.ErrBadConn so database/sql discards the
connection. Since v1.12.0 this could result in permanently broken connections,
especially with CockroachDB which frequently sends partial messages (#1299).
The next release may change the default sslmode from require to prefer.
See #1271 for details.
CopyIn() and CopyInToSchema() have been marked as deprecated. These are
simple query builders and not needed for COPY [..] FROM STDIN support (which
is not deprecated). (#1279)
// Old
tx.Prepare(CopyIn("temp", "num", "text", "blob", "nothing"))
// Replacement
tx.Prepare(`copy temp (num, text, blob, nothing) from stdin`)
Features
Support protocol 3.2, and the min_protocol_version and max_protocol_version DSN parameters (#1258).
Support sslmode=prefer and sslmode=allow (#1270).
Support ssl_min_protocol_version and ssl_max_protocol_version (#1277).
Support connection service file to load connection details (#1285).
Support sslrootcert=system and use ~/.postgresql/root.crt as the default
value of sslrootcert (#1280, #1281).
Add a new pqerror package with PostgreSQL error codes (#1275).
For example, to test if an error is a UNIQUE constraint violation:
if pqErr, ok := errors.AsType[*pq.Error](err); ok && pqErr.Code == pqerror.UniqueViolation {
log.Fatalf("email %q already exsts", email)
}
To make this a bit more convenient, it also adds a pq.As() function:
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/lib/pq](https://github.com/lib/pq) | require | minor | `v1.11.2` → `v1.12.3` |
---
### Release Notes
<details>
<summary>lib/pq (github.com/lib/pq)</summary>
### [`v1.12.3`](https://github.com/lib/pq/blob/HEAD/CHANGELOG.md#v1123-2026-04-03)
[Compare Source](https://github.com/lib/pq/compare/v1.12.2...v1.12.3)
- Send datestyle startup parameter, improving compatbility with database engines
that use a different default datestyle such as EnterpriseDB ([#​1312]).
[#​1312]: https://github.com/lib/pq/pull/1312
### [`v1.12.2`](https://github.com/lib/pq/blob/HEAD/CHANGELOG.md#v1122-2026-04-02)
[Compare Source](https://github.com/lib/pq/compare/v1.12.1...v1.12.2)
- Treat io.ErrUnexpectedEOF as driver.ErrBadConn so database/sql discards the
connection. Since v1.12.0 this could result in permanently broken connections,
especially with CockroachDB which frequently sends partial messages ([#​1299]).
[#​1299]: https://github.com/lib/pq/pull/1299
### [`v1.12.1`](https://github.com/lib/pq/blob/HEAD/CHANGELOG.md#v1121-2026-03-30)
[Compare Source](https://github.com/lib/pq/compare/v1.12.0...v1.12.1)
- Look for pgpass file in \~/.pgpass instead of \~/.postgresql/pgpass ([#​1300]).
- Don't clear password if directly set on pq.Config ([#​1302]).
[#​1300]: https://github.com/lib/pq/pull/1300
[#​1302]: https://github.com/lib/pq/pull/1302
### [`v1.12.0`](https://github.com/lib/pq/blob/HEAD/CHANGELOG.md#v1120-2026-03-18)
[Compare Source](https://github.com/lib/pq/compare/v1.11.2...v1.12.0)
- The next release may change the default sslmode from `require` to `prefer`.
See [#​1271] for details.
- `CopyIn()` and `CopyInToSchema()` have been marked as deprecated. These are
simple query builders and not needed for `COPY [..] FROM STDIN` support (which
is *not* deprecated). ([#​1279])
```
// Old
tx.Prepare(CopyIn("temp", "num", "text", "blob", "nothing"))
// Replacement
tx.Prepare(`copy temp (num, text, blob, nothing) from stdin`)
```
##### Features
- Support protocol 3.2, and the `min_protocol_version` and
`max_protocol_version` DSN parameters ([#​1258]).
- Support `sslmode=prefer` and `sslmode=allow` ([#​1270]).
- Support `ssl_min_protocol_version` and `ssl_max_protocol_version` ([#​1277]).
- Support connection service file to load connection details ([#​1285]).
- Support `sslrootcert=system` and use `~/.postgresql/root.crt` as the default
value of sslrootcert ([#​1280], [#​1281]).
- Add a new `pqerror` package with PostgreSQL error codes ([#​1275]).
For example, to test if an error is a UNIQUE constraint violation:
```
if pqErr, ok := errors.AsType[*pq.Error](err); ok && pqErr.Code == pqerror.UniqueViolation {
log.Fatalf("email %q already exsts", email)
}
```
To make this a bit more convenient, it also adds a `pq.As()` function:
```
pqErr := pq.As(err, pqerror.UniqueViolation)
if pqErr != nil {
log.Fatalf("email %q already exsts", email)
}
```
##### Fixes
- Fix SSL key permission check to allow modes stricter than [0600/0640#1265](https://github.com/0600/0640/issues/1265) ([#​1265]).
- Fix Hstore to work with binary parameters ([#​1278]).
- Clearer error when starting a new query while pq is still processing another
query ([#​1272]).
- Send intermediate CAs with client certificates, so they can be signed by an
intermediate CA ([#​1267]).
- Use `time.UTC` for UTC aliases such as `Etc/UTC` ([#​1282]).
[#​1258]: https://github.com/lib/pq/pull/1258
[#​1265]: https://github.com/lib/pq/pull/1265
[#​1267]: https://github.com/lib/pq/pull/1267
[#​1270]: https://github.com/lib/pq/pull/1270
[#​1271]: https://github.com/lib/pq/pull/1271
[#​1272]: https://github.com/lib/pq/pull/1272
[#​1275]: https://github.com/lib/pq/pull/1275
[#​1277]: https://github.com/lib/pq/pull/1277
[#​1278]: https://github.com/lib/pq/pull/1278
[#​1279]: https://github.com/lib/pq/pull/1279
[#​1280]: https://github.com/lib/pq/pull/1280
[#​1281]: https://github.com/lib/pq/pull/1281
[#​1282]: https://github.com/lib/pq/pull/1282
[#​1283]: https://github.com/lib/pq/pull/1283
[#​1285]: https://github.com/lib/pq/pull/1285
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzYuMyIsInVwZGF0ZWRJblZlciI6IjQzLjEzNi4zIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlL2F1dG9tZXJnZSIsInJlbm92YXRlL2dvbGFuZyJdfQ==-->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
v1.11.2→v1.12.3Release Notes
lib/pq (github.com/lib/pq)
v1.12.3Compare Source
that use a different default datestyle such as EnterpriseDB (#1312).
v1.12.2Compare Source
connection. Since v1.12.0 this could result in permanently broken connections,
especially with CockroachDB which frequently sends partial messages (#1299).
v1.12.1Compare Source
Look for pgpass file in ~/.pgpass instead of ~/.postgresql/pgpass (#1300).
Don't clear password if directly set on pq.Config (#1302).
v1.12.0Compare Source
The next release may change the default sslmode from
requiretoprefer.See #1271 for details.
CopyIn()andCopyInToSchema()have been marked as deprecated. These aresimple query builders and not needed for
COPY [..] FROM STDINsupport (whichis not deprecated). (#1279)
Features
Support protocol 3.2, and the
min_protocol_versionandmax_protocol_versionDSN parameters (#1258).Support
sslmode=preferandsslmode=allow(#1270).Support
ssl_min_protocol_versionandssl_max_protocol_version(#1277).Support connection service file to load connection details (#1285).
Support
sslrootcert=systemand use~/.postgresql/root.crtas the defaultvalue of sslrootcert (#1280, #1281).
Add a new
pqerrorpackage with PostgreSQL error codes (#1275).For example, to test if an error is a UNIQUE constraint violation:
To make this a bit more convenient, it also adds a
pq.As()function:Fixes
Fix SSL key permission check to allow modes stricter than 0600/0640#1265 (#1265).
Fix Hstore to work with binary parameters (#1278).
Clearer error when starting a new query while pq is still processing another
query (#1272).
Send intermediate CAs with client certificates, so they can be signed by an
intermediate CA (#1267).
Use
time.UTCfor UTC aliases such asEtc/UTC(#1282).Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.