This should substantially reduce memory allocations and memory copies.
It also means that PostgreSQL messages are always entirely buffered in memory
before processing begins. This simplifies the message processing code.
In particular, Conn.WaitForNotification is dramatically simplified by this
change.
Previous commits had a race condition due to not waiting for the PostgreSQL
server to close the cancel query connection. This made it possible for the
cancel request to impact a subsequent query on the same connection. This
commit sets a flag that a cancel request was made and blocks until the
PostgreSQL server closes the cancel connection.
* 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
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.
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.