298 Commits

Author SHA1 Message Date
Jack Christensen
6996e8d6c5 Context errors returned instead of net.Error
The net.Error caused by using SetDeadline to implement context
cancellation shouldn't leak.

fixes #80
2021-07-24 09:09:22 -05:00
Jack Christensen
13d454882b Release v1.9.0 2021-07-10 09:54:39 -05:00
Jack Christensen
5b7c6a3c8e Upgrade to pgproto3 v2.1.1 2021-07-10 09:54:24 -05:00
Michael Darr
a50d96d491 Make timeout error private
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr
9a9830c00d Always double-wrap contextAlreadyDoneError
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr
b3e64d3cdb Simplify SafeToRetry for ErrTimeout
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr
c0b4d3bc05 Implement timeout error
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Joshua Brindle
a123e5b4e5 Add defaults for sslcert, sslkey, and sslrootcert
per https://www.postgresql.org/docs/current/libpq-ssl.html
psql will use client certs located in ~/.postgresql on posix systems
or %APPDATA%\postgresql on Windows systems.
2021-06-26 11:25:41 -05:00
mgoddard
bf76d1ed51 Solve issue with 'sslmode=verify-full' when there are multiple hosts 2021-06-19 10:14:17 -05:00
Sivabalan Thirunavukkarasu
bacf81fb4e Bumping versions for other dependencies 2021-06-19 10:06:47 -05:00
Sivabalan Thirunavukkarasu
cfcd61d0cb Updating dependency versions 2021-06-19 10:06:47 -05:00
Jack Christensen
fb42201c18 Fix default host when parsing URL without host but with port
fixes https://github.com/jackc/pgconn/issues/72
2021-05-14 18:39:31 -05:00
Jack Christensen
3f76b98073 Allow dbname query parameter in URL conn string
fixes #69
2021-04-09 18:20:06 -05:00
Jack Christensen
464a7d88d9 Release v1.8.1 2021-03-25 09:15:45 -04:00
Jack Christensen
cdb667b5b0 Update copyright date 2021-03-25 09:15:45 -04:00
Ethan Pailes
e8f75629d0 upgrade x/crypto to avoid CVE-2020-9283
I found this when scanning for security issues in some
dependencies. I doubt that this CVE will impact pgconn
since I don't think it uses the ssh cropto module, but
I think it is worth being fairly agressive about upgrading
security sensative libraries and this doesn't seem to be
a breaking change.
2021-03-23 07:44:35 -05:00
Andrey Borodin
8990c125cf Stop fallback on ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION 2021-03-12 08:31:29 -06:00
Andrey Borodin
b6027e37f4 Stop fallback in case of invalid password 2021-03-12 08:31:29 -06:00
Andrey Borodin
70be4b4a02 Fix incoherent type assignment 2021-03-12 08:31:29 -06:00
Andrey Borodin
26ccb4ee08 Resume fallback on server error
When server responds with "TLS required" or too "many connections for role" fallbacks are not traversed any further. This could be OK, but fallbacks without TLS are added autoatically so that if we have multiple hosts requiring TLS we never traverse beyond first one.
2021-03-12 08:31:29 -06:00
Jack Christensen
5daa019e4e Update README.md to authentication test setup 2021-03-06 16:08:38 -06:00
Jack Christensen
0d307bcc5e Add CockroachDB to CI 2021-03-06 16:06:32 -06:00
Jack Christensen
1e905d8e38 Refactor connection strings into build matrix
This is in preparation for adding CockroachDB to the build matrix.
2021-03-06 15:20:03 -06:00
Jack Christensen
7de3392269 Manually specify all build matrix options
- Saves some CI time by only testing older version of Go once
- Specify connection
2021-03-06 15:15:03 -06:00
Jack Christensen
a0350a932a ci.yml consistently uses kebab case 2021-03-06 15:01:44 -06:00
Jack Christensen
cf5894e092 Use std errors instead of golang.org/x/xerrors
New error functionality was introduced in Go 1.13. pgconn only
officially supports 1.15+. Transitional xerrors package can now be
removed.
2021-03-06 14:45:33 -06:00
Jack Christensen
3b0400a0d4 Test Go 1.15 and 1.16 in CI 2021-03-06 14:42:22 -06:00
Georges Varouchas
36c8fb8257 fix #65 : close cleanupDone channel on "FATAL" messages 2021-03-06 09:33:36 -06:00
Georges Varouchas
b9a1aad8d9 add failing test to highlight issue #65
if frontend returns a message with "Severity: FATAL", even after
calling "conn.Close()", the 'CleanupDone()' channel is still blocking
2021-03-06 09:33:36 -06:00
Jack Christensen
fb88a34cb4 Skip test with known issue on CockroachDB 2021-02-20 16:40:16 -06:00
Jack Christensen
4bde08d1a6 LRU statement cache tests handle CockroackDB 2021-02-13 11:19:09 -06:00
Jack Christensen
d05c52217a Initial CockroachDB testing 2021-02-13 10:47:22 -06:00
Jack Christensen
a78ab5bdcd Test should abort if cannot setup database 2021-02-13 09:39:42 -06:00
Jack Christensen
9cf5752625 Change Github CI to run on master 2021-01-30 16:48:51 -06:00
Jack Christensen
609cd81d64 Remove obsolete Travis badge 2021-01-30 16:47:51 -06:00
Jack Christensen
ed0090f610 Use race detector on Github CI 2021-01-30 16:44:17 -06:00
Jack Christensen
c10c60cad5 Add build matrix for Go and PG 2021-01-30 16:38:58 -06:00
Jack Christensen
c107f909a2 Create user for Unix domain socket 2021-01-30 16:28:27 -06:00
Jack Christensen
eb32285906 Use native PostgreSQL package
Also remove travis integration.
2021-01-30 16:22:38 -06:00
Jack Christensen
94608a2482 Merge branch 'master' into github-ci-wip 2021-01-30 13:05:59 -06:00
Jack Christensen
74517d7315 Fix test when PGSSLMODE=disable
When PGSSLMODE=disable no fallback config was created which would cause
the check that fallbacks are deep copied to crash on:

copied.Fallbacks[0].Port = uint16(5433)
2021-01-30 13:03:56 -06:00
Jack Christensen
a9c2b5c3cb Revert "Try to debug failing CI test"
This reverts commit 6c2a423dbc25d634270b04ecaac7a1d644037945.
2021-01-30 13:01:27 -06:00
Jack Christensen
6c2a423dbc Try to debug failing CI test 2021-01-30 12:58:25 -06:00
Jack Christensen
63bcdfde61 Fix CI link 2021-01-30 12:48:58 -06:00
Jack Christensen
7d8845a9d8 Initial import from pgtype 2021-01-30 12:47:34 -06:00
Jack Christensen
120139a206 Add link to PG docs for connString format
fixes #62
2021-01-14 18:22:21 -06:00
Moshe Katz
724bf94515 use proper pgpass location on Windows 2021-01-09 09:36:36 -06:00
Jack Christensen
e276d9b832 Add more documentation to TxStatus 2020-12-23 12:21:34 -06:00
ip.novikov
e0d22c1100 improve regexp
get shortest sequence between : and @
2020-12-05 22:11:52 +03:00
ip.novikov
a581247a12 Add check for url with broken password
replace broken password in parseConfigError message
2020-12-05 15:28:01 +03:00