2938 Commits

Author SHA1 Message Date
Dan Gillis
8876b3a4ff Add comments 2021-09-11 11:07:31 -05:00
Jack Christensen
435605a59c Fix pgxpool BatchResults for QueryFunc 2021-09-11 11:05:44 -05:00
Jack Christensen
693c7c7f7d Fix NULL being lost when scanning unknown OID into sql.Scanner
https://github.com/jackc/pgx/issues/1078
2021-09-11 10:59:26 -05:00
Jack Christensen
38cd1b40aa Add QueryFunc to BatchResults
https://github.com/jackc/pgx/issues/1048#issuecomment-915123822
2021-09-11 10:32:02 -05:00
Kei Kamikawa
3bee0c6398 removed lines to read conn 2021-08-28 08:52:37 -05:00
Jack Christensen
90af821478 Remove old Travis CI code 2021-08-26 21:09:46 -05:00
Jack Christensen
30d7638296 Fix zeronull.Float8 2021-08-26 15:42:47 -05:00
Jack Christensen
39aa071b15 Add zeronull float8 2021-08-26 13:21:02 -05:00
Rulin Tang
5320ad87c8 remove query row connection release 2021-08-23 11:39:45 -05:00
Rulin Tang
c9e271df29 add missing pgx pool release for QueryRow 2021-08-23 11:39:45 -05:00
Carl Dunham
94f8441f4e Fix #119: add support for bare IP address as input for Inet 2021-08-12 17:50:31 -05:00
Don2Quixote
23b4656fc5 Made error check conditions clearer 2021-08-09 08:41:07 -05:00
Eli Treuherz
db84905b7f Add NullDecimal to shopspring-numeric
The shopspring/decimal package provides a NullDecimal struct intended
for use with nullable SQL NUMERICs and numbers. It has Scanner and
Valuer implementations already, but adding it to this package allows
it to be used with the binary encoding as well.

The implementation is very straightforward, but the tests have been made
slightly more complicated. The previous version wasn't testing the
decimal.Decimal cases, and this change adds those as well as new
NullDecimal cases. I've added some logic to the test harness to catch
these as you need to use the Equals method to properly compare Decimals.
2021-08-07 08:23:02 -05:00
Jack Christensen
6bda09691d Fix hstore binary null decoding
Bug was advancing the read pointer by the length of the value even if it
was a NULL value. Since NULL is indicated by a -1 length it actually
decremented the read pointer.
2021-07-31 11:06:03 -05:00
Jack Christensen
8f33ed07cd Release v4.13.0 v4.13.0 2021-07-24 10:59:24 -05:00
Jack Christensen
24f1d26fde Upgrade pgconn and pgtype 2021-07-24 10:55:24 -05:00
Jack Christensen
53f5fed36c Release v1.10.0 2021-07-24 10:52:26 -05:00
Jack Christensen
e26c6b4e3d Release v1.8.1 2021-07-24 10:50:22 -05:00
Jack Christensen
377eed5d2f Cleaning go.sum 2021-07-24 10:48:07 -05:00
Jack Christensen
c16a4f7d6a Revert "Temporarily delete tests and pgxtype to break recursive dependency with pgx"
This reverts commit 32e20a603178b49fb189d1be971d0fb6960cabb2.
2021-07-24 10:40:30 -05:00
Jack Christensen
640aa07df1 Temporary step to clean up go.sum 2021-07-24 10:39:13 -05:00
Jack Christensen
d89c8390a5 Update dependencies and go mod tidy 2021-07-24 10:25:38 -05:00
Jack Christensen
32e20a6031 Temporarily delete tests and pgxtype to break recursive dependency with pgx 2021-07-24 10:16:00 -05:00
Jack Christensen
7d0a620dda Upgrade pgx version used for tests 2021-07-24 09:20:54 -05:00
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
Michael Darr
59fa1868a7 Support time durations for simple protocol
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-17 09:01:57 -05:00
KeiichiHirobe
1470d69c58 go mod tidy 2021-07-17 08:39:31 -05:00
KeiichiHirobe
48f39340b3 switch from github.com/go-kit/kit/log to github.com/go-kit/log 2021-07-17 08:39:31 -05:00
Jack Christensen
9ee04e87e3 Release v4.12.0 v4.12.0 2021-07-10 10:06:00 -05:00
Jack Christensen
785f279272 Upgrade dependencies 2021-07-10 10:02:16 -05:00
Jack Christensen
dcdc3eaec7 Release v1.8.0 2021-07-10 09:58:12 -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
Yuli Khodorkovskiy
033ca7d47f Fix unexpected EOF failure for StartupMessage 2021-07-07 18:10:44 -05:00
Nicholas Wilson
aafa04c156 Use zap.Any for handling interface{} -> zap.Field conversion
zap.Any falls back to zap.Reflect, but is better for this case, because
it first checks for the types that zap handles specially.  For example,
time.Duration, or error, which zap.Reflect will just treat as untyped
int64 or struct objects, but zap.Any is able to detect these types and
print them properly.
2021-07-06 20:18:16 -05:00
Jack Christensen
6bce4a1878
Merge pull request #19 from gitstashpop/backend-unexpected-eof
Extend handling of unexpected EOF to the backend
2021-07-06 20:08:14 -05:00
Jack Christensen
aaef9bbc35
Merge branch 'master' into backend-unexpected-eof 2021-07-06 20:07:55 -05:00
Yuli Khodorkovskiy
2d3823838e Perform StartupMessage length validation
PG provides a maximum size for a StartupMessage:
https://doxygen.postgresql.org/pqcomm_8h.html#a4c50c668c551887ac3a49872130349e3

Limiting the size ensures a malicious user doesn't send an
overwhelmingly large StartupMessage which could DOS a Go binary that
uses pgproto3.
2021-07-06 20:01:33 -05:00
Cameron Daniel
3eceab0f38 Maintain host bits for inet types 2021-07-06 19:59:41 -05:00
Yuli Khodorkovskiy
10c6c50ac9
Extend handling of unexpected EOF to the backend
In the original issue [1] and commit [2], support for unexpected EOF was
added to the frontend to detect when a connection was closed abruptly.
Additionally, this allows us to differentiate normal io.EOF errors with
unexpected errors in the backend.

[1] https://github.com/jackc/pgx/issues/662/
[2] 595780be0f
2021-07-01 17:53:14 -04: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
Aliaksandr Mianzhynski
4a2209a1b4 Don't allocate buffer when tx opts are empty 2021-06-26 10:52:09 -05:00
Jack Christensen
2ca304d461 pgtype.Inet preserves masked address portion
fixes #111
2021-06-26 10:49:56 -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