334 Commits

Author SHA1 Message Date
Jack Christensen
0d4f029683 Exec(Params|Prepared) return ResultReader with FieldDescriptions loaded
Previously, it wasn't loaded until NextRow was called the first time.
2020-09-05 13:14:14 -05:00
Sebastiaan Mannem
5db484908c Changing SendBytesWithResults to ReceiveResults (that only does the reading). 2020-08-22 20:38:04 -05:00
Sebastiaan Mannem
1debbfeec4 Adding SendBytesWithResults option to receive data after sending a message (used by copy-both) 2020-08-22 20:38:04 -05:00
Jack Christensen
fdfc783345 Rename CleanupChan to CleanupDone 2020-08-20 22:08:40 -05:00
Jack Christensen
3eb5432c47 Add PgConn.CleanupChan 2020-08-20 22:00:21 -05:00
Jack Christensen
c894ca8b7d Update pgproto3 to v2.0.4 2020-08-01 05:49:56 -05:00
Jack Christensen
b6e34b44e5 Update pgproto3 2020-07-31 17:04:18 -05:00
Jack Christensen
f45b4d6b76 Release v1.6.4 2020-07-29 22:17:02 -05:00
Jack Christensen
44079b0d2c Fix panic on parsing DSN with trailing '='
Also correctly return error with leading '='.

fixes #47
2020-07-29 22:11:15 -05:00
Jack Christensen
4e4c4ea541 Fix deadlock on error after CommandComplete but before ReadyForQuery
See: https://github.com/jackc/pgx/issues/800
2020-07-29 21:47:23 -05:00
Jack Christensen
37c9edc242 Release v1.6.3 2020-07-22 06:43:39 -05:00
vahid-sohrabloo
271b0ac95e AppendCertsFromPEM doesn't have error and removes pgTLSArgs
AppendCertsFromPEM doesn't have error and removes pgTLSArgs because not used
2020-07-18 08:50:12 -05:00
Jack Christensen
9295bf7483 Update changelog 2020-07-14 12:07:27 -05:00
Jack Christensen
12752ce5d6 Update pgservicefile 2020-07-13 19:34:45 -05:00
Jack Christensen
503c2b445f Release v1.6.1 2020-06-27 11:51:30 -05:00
Jack Christensen
bd7ffdb480 Update golang.org/x/crypto dependency 2020-06-27 11:48:20 -05:00
Jack Christensen
65717779e4 Fix crash when PGSERVICE not found 2020-06-27 11:46:16 -05:00
Jack Christensen
82c2752e71 Update golang.org/x/text to 0.3.3
golang.org/x/text had a vulnerability:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14040

pgconn does not appear to use the affected code path, but it is still
worth updating away from the vulnerable version.

fixes #44
2020-06-27 11:35:23 -05:00
Jack Christensen
473062b114 Remove NewConfig and add more docs for ParseConfig
refs #42
2020-06-27 11:29:21 -05:00
Jack Christensen
7cf5101bb2 Add NewConfig()
refs #42
2020-06-20 12:59:15 -05:00
Jack Christensen
6c16d6c00e
Merge pull request #43 from lukedirtwalker/redactPW
redact passwords in parse config errors
2020-06-13 07:19:15 -05:00
Lukas Vogel
f27e874d55 redact passwords in parse config errors
Redact passwords when printing the parseConfigError in a best effort manner.
This prevents people from leaking the password into logs, if they just print the error in logs.
2020-06-12 13:01:57 +02:00
Jack Christensen
a1b9eb4d4e Fix parseServiceSettings not returning error 2020-06-11 20:55:41 -05:00
Jack Christensen
6b254a445e Fix doc for ParseConfig 2020-06-11 20:51:40 -05:00
Jack Christensen
59a0074b0a Release v1.6.0 2020-06-06 10:52:55 -05:00
Jack Christensen
6cd2127b96 Update pgproto3 dependency 2020-06-06 10:52:07 -05:00
Jack Christensen
fa742c5248
Merge pull request #41 from georgysavva/add-config-copy
Add Config.Copy() method that returns a smart copy of the config.
2020-06-01 13:11:01 -05:00
georgysavva
a6d9265506 Implement deep copy manually, stop using an external deep copy library. Add comment to the Config.Copy() method. 2020-06-01 20:52:08 +03:00
georgysavva
8d541d0004 Add Config.Copy() method that return a smart copy of the config. 2020-06-01 19:20:17 +03:00
Jack Christensen
2647eff567 Fix ValidateConnect with cancelable context
fixes #40
2020-05-25 11:49:37 -05:00
Jack Christensen
8c33aa2443 Remove CPU wasting empty default statement
fixes #39
2020-05-23 11:47:42 -05:00
Jack Christensen
2ccb66fe21 Doc fix 2020-05-16 18:48:05 -05:00
Jack Christensen
18d2604119
Merge pull request #38 from lukedirtwalker/fixIPv6
Handle IPv6 in connection URLs
2020-05-13 08:50:38 -05:00
Jack Christensen
39f9d6079c Merge branch 'georgysavva-improve-connect-timeout' 2020-05-13 07:43:45 -05:00
Jack Christensen
fafefa6063 Merge branch 'improve-connect-timeout' of git://github.com/georgysavva/pgconn into georgysavva-improve-connect-timeout 2020-05-13 07:43:15 -05:00
Jack Christensen
fb54a80edf
Merge pull request #36 from Eun/patch-1
concludeCommand should not throw away fieldDescriptions
2020-05-13 07:38:08 -05:00
Lukas Vogel
08d071c094 Handle IPv6 in connection URLs
Previously IPv6 addresses were wrongly split and lead to a parse error.
This commit fixes the behavior.
2020-05-12 10:39:35 +02:00
Jack Christensen
c4e6445cc7 Explicitly test supported Go and PostgreSQL versions 2020-05-09 10:19:39 -05:00
georgysavva
01a7510ae9 Reformat imports 2020-05-02 16:43:02 +03:00
georgysavva
2d5a17beab Add comment. 2020-05-02 16:39:51 +03:00
georgysavva
391e1ef2ce Parse connect timeout setting into Config. Restrict context timeout via Config.ConnectTimeout on .Connect() call. 2020-05-02 16:35:22 +03:00
Tobias Salzmann
8d9293e1e7
Update pgconn.go 2020-04-30 11:27:01 +02:00
Tobias Salzmann
8f3f335b0f
concludeCommand should not throw away fieldDescriptions 2020-04-30 11:22:43 +02:00
Jack Christensen
15856c001a
Merge pull request #33 from pjediny/sslmode-require-with-rootca
Fix behavior of sslmode=require with sslrootcert present
2020-04-07 20:00:31 -05:00
Jack Christensen
5d2be99c25 Fix panic when closing conn during cancellable query
fixes #29
2020-04-07 19:38:21 -05:00
Petr Jediný
84aee0ab44 Fix behavior of sslmode=require with sslrootcert present
According to PostgreSQL documentation the behavior should be
the same as that of verify-ca sslmode

https://www.postgresql.org/docs/12/libpq-ssl.html
2020-04-08 00:08:53 +02:00
Jack Christensen
e4f3224f4c Update changelog for v1.5.0 2020-03-30 11:15:08 -05:00
Jack Christensen
11d9f4e54f Update golang.org/x/crypto for security fix 2020-03-30 11:09:29 -05:00
Jack Christensen
87c8ddd0d1
Merge pull request #32 from gcurtis/verify-ca
Implement "verify-ca" SSL mode
2020-03-21 11:13:55 -05:00
Greg Curtis
4ed48d05d2 Implement "verify-ca" SSL mode
ParseConfig currently treats the libpq "verify-ca" SSL mode as
"verify-full". This is okay from a security standpoint because
"verify-full" performs certificate verification and hostname
verification, whereas "verify-ca" only performs certificate
verification.

The downside to this approach is that checking the hostname is
unnecessary when the server's certificate has been signed by a private
CA. It can also cause the SSL handshake to fail when connecting to an
instance by IP. For example, a Google Cloud SQL instance typically
doesn't have a hostname and uses its own private CA to sign its
server and client certs.

This change uses the tls.Config.VerifyPeerCertificate function to
perform certificate verification without checking the hostname when the
"verify-ca" SSL mode is set. This brings pgconn's behavior closer to
that of libpq.

See https://github.com/golang/go/issues/21971#issuecomment-332693931
and https://pkg.go.dev/crypto/tls?tab=doc#example-Config-VerifyPeerCertificate
for more details on how this is implemented.
2020-03-17 23:36:06 -07:00