201 Commits

Author SHA1 Message Date
Jack Christensen
f895e970b5 Merge branch 'master' into v3-experimental
* master:
  Tweak replication test setup
  Properly make it a func init()
  The naming really matters
  Fix the syntax
  Properly make the replication tests skippable on 9.5 and below
  I forgot the tests are 9.6+
  One more try for travis
  Valid YAML helps.
  Dont break old postgres
  Try to fix travis
  Add the ability to set all the fields in the constructor
  Start replication now wraps the sql and returns errors properly
  It should all be unsigned.
  Capitalization
  Add replication stop mechanism
  Add basic logical replication protocol support
2017-01-06 15:25:57 -06:00
Jack Christensen
93e5c68f69 Merge branch 'master' into v3-experimental 2016-12-10 12:21:08 -06:00
Kris Wehner
7bbb1c7307 Add basic logical replication protocol support 2016-12-04 21:35:22 -08:00
ferhat elmas
84439a13cb Simplify map composite literals as gofmt -s handles 2016-11-09 00:52:10 +01:00
Jack Christensen
3734a92a71 Log TLS connection errors as info when fallback available
fixes #198
2016-10-21 14:27:38 -05:00
Jack Christensen
f7b6b3f077 Handle json/jsonb in binary to support CopyTo
fixes #189
2016-10-01 11:01:54 -05:00
Martin Hamrle
9f6b99e332 Cleanups
Cleanups suggested by gometalinter tools.
2016-08-30 20:05:44 +02:00
Jack Christensen
73124171e2 Rename Pid to PID 2016-08-02 15:10:00 -05:00
Jack Christensen
390f75c0e1 Reduce Logger interface to Log method 2016-08-02 14:42:31 -05:00
Jack Christensen
214443deb7 Rename Oid to OID 2016-08-02 13:31:55 -05:00
Jack Christensen
30cb421551 Add basic record to []interface{} decoding
refs #155
2016-06-21 15:00:47 -05:00
Jack Christensen
40f00f4a82 Pass PrepareEx opts as pointer and DRY implementation 2016-05-20 08:30:10 -05:00
Jack Christensen
7954a36b2d Tweak Prepare docs 2016-05-20 08:16:28 -05:00
Jack Christensen
b06560aa03 Rename Preparex to PrepareEx 2016-05-20 08:14:56 -05:00
William King
2ba5bb405b Slight doc update 2016-05-18 13:27:22 -07:00
William King
e417cc2f15 Preparex 2016-05-18 13:15:15 -07:00
Jack Christensen
90f22c1717 Don't share inet constant memory between connections 2016-05-12 08:00:53 -05:00
Jack Christensen
a488fe026f Every Conn in a ConnPool gets its own PgTypes
Rather than sharing which could allow data races.
2016-05-12 07:51:53 -05:00
John Barker
a282d9df90 Cache connection properties in the pool
This is a quick attempt to improve connection startup time by caching
the properties that are loaded when a connection is ready in the pool,
so that further connections don't incur this cost.

I'm not entirely convinced by the interface here, perhaps these 3 items
could live in their own type and that be passed around for clearer code,
but the idea works well.
2016-05-10 18:34:26 -04:00
John Barker
3ac09ce728 Reduce the set of types loaded on connect [Fixes #140]
Modify the pg_types query so that it does not load the table array types
that are created when new tables are created.
2016-05-10 14:10:51 -04:00
Jack Christensen
7323d3f5a7 Encode/decode [][]byte to/from bytea[]
fixes #139
2016-04-30 19:07:29 -05:00
Jack Christensen
b596fa3455 Avoid allocation for WriteBuf on query 2016-04-30 13:32:19 -05:00
Jack Christensen
e5ec5851e5 Reduce allocations for row objects 2016-04-30 12:22:36 -05:00
Jack Christensen
04e9fbcc55 Fix some golint errors
- Add comments
- Rename variables
- Remove unnecessary "else"
2016-03-29 15:18:09 -05:00
Jack Christensen
9ce1b2b16e Fix Listen/Unlisten with special characters
fixes #132
2016-03-24 15:26:44 -05:00
Jack Christensen
c6b6d7bad7 Expose encoding and decoding functions 2016-02-15 13:57:11 -06:00
Jack Christensen
0f7bf19387 Add *Conn.SetLogLevel
Allow changing log level after connection is established. Because
log level and loggers can be set independently, it is now possible
to have a log level above none when there is a nil logger. This
means all log statements need to check for nil logger and an
appropriate log level. This check has been factored out into
*Conn.shouldLog.
2016-02-13 10:13:10 -06:00
Jack Christensen
cffae7ff5d Add SetLogger to *Conn
Allow replacing logger after connection is established. Also
refactor internals of logging such that there is a log method that
adds the pid to all log calls instead of making a new logger object.
The reason for this is so pid will be logged regardless of whether
loggers are replaced and restored.
2016-02-12 17:49:04 -06:00
Jack Christensen
9f9a9779ac Add compatibility with database/sql custom types
Support database/sql.Scanner
Support database/sql/driver.Valuer
2015-12-31 14:46:43 -06:00
Jack Christensen
f004f0802c Add ConnPool.Reset method
refs #110
2015-12-12 13:15:14 -06:00
Jack Christensen
dd26ad0091 Remove unreachable code 2015-11-14 14:14:52 -06:00
Jack Christensen
e1215d9b19 []byte skips encoding/decoding
refs #104
2015-11-12 14:54:25 -06:00
Jack Christensen
60cca3de7d Disable SSL renegotiation
fixes #103
2015-10-26 12:07:54 -05:00
Jack Christensen
8d9eb62609 Add docs for relating to ConnConfig.RuntimeParams 2015-10-16 16:16:39 -05:00
Jack Christensen
ec8f6259e6 ParseEnvLibpq extracts PGAPPNAME 2015-10-16 16:13:15 -05:00
Jack Christensen
829d61ce40 ParseDSN extracts RuntimeParams 2015-10-16 15:48:24 -05:00
Jack Christensen
5b0550c1cb ParseURI extracts run-time parameters
refs #99
2015-10-16 15:37:49 -05:00
Jack Christensen
1fb63a4b41 Add RuntimeParams to ConnConfig 2015-10-16 15:37:32 -05:00
Jack Christensen
41b96b5f77 Fix stdlib error caused by idempotent Prepare 2015-10-16 14:58:03 -05:00
Jack Christensen
984eace2b5 Make *Conn.Prepare idempotent.
fixes #94
2015-10-16 14:17:07 -05:00
Jack Christensen and Jake Worth
c726a51450 Add inet[] and cidr[] support 2015-09-29 13:23:26 -05:00
Jack Christensen
4987d5425e Fix JSON encoding of *string 2015-09-21 13:40:47 -05:00
Jack Christensen
ca16a4c98f Unlisten tweaks
- Use unlisten * when releasing connection with listeners to pool
- Only unlisten on releasing connection to pool when necessary
- Remove Unlisten("") as was to release all listeners
2015-09-21 08:18:10 -05:00
Joseph Glanville
eb5cadccf9 Track Listen/Unlisten and clear subscriptions on conn release 2015-09-21 07:56:45 -05:00
Jack Christensen
86837e5576 Add guards against usage of busy connection 2015-09-16 10:22:16 -05:00
Jack Christensen
23c48c2f87 Add trace logging 2015-09-16 08:40:01 -05:00
Jack Christensen
a1aa06c934 More efficient logging with log levels 2015-09-16 08:20:51 -05:00
Jack Christensen
a2e078597b Add logging to rxMsg
Also benchmark what a log call costs
2015-09-14 10:25:48 -05:00
Jack Christensen
6e5fa60c4c Fix cases where net conn write failure was not marking connection as dead
Also added loop to run these timing sensitive tests multiple times.
2015-09-12 19:32:55 -05:00
Jack Christensen
4ff46becfc Generalize pointer to string uuid transcoding to any non-varchar/text type 2015-09-09 18:07:05 -05:00