Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cmelbye/pq
base: ea776ca310
head fork: cmelbye/pq
compare: 46abf4a0ee
Commits on Feb 02, 2014
@johto johto Implement fallback_application_name
This is a libpq-compatible parameter which can be used by generic
programs to provide a "default" application_name the user can override
via application_name or PGAPPNAME.
Commits on Feb 06, 2014
@fabienengels fabienengels Fix typo in Errors chapter b7b3322
Commits on Feb 08, 2014
@johto johto Add support for LISTEN/NOTIFY
This commit adds support for the PostgreSQL LISTEN/NOTIFY mechanism by
adding two new user-exposed interfaces:

  - ListenerConn is a low level interface which establishes a connection
    to a PostgreSQL server and only knows how to execute simple queries
    and wait for notifications.  This interface does not know how to
    reconnect, and does not maintain a list of the channels it is
    listening on.  Its use is discouraged.
  - Listener is the higher-level interface which uses ListenerConn
    underneath to provide a simpler to use interface, supporting
    automatic reconnection.  In order to do that, it also maintains a
    list of channels it is already listening on.

Significant contributions and ideas from Tommie Gannert.  Ideas and
valuable feedback from Kamil Kisiel, Maciek Sakrejda and Paul Hammond.
@johto johto gofmt notify_test.go 3e128b3
@johto johto Fix merge conflict in README
I failed to notice this in commit 224d938.
@johto johto Remove references to senderToken
This was replaced with senderLock at some point during the development,
but some old comments weren't fixed.
@johto johto Fix typo in error message 46d1f25
Commits on Feb 12, 2014
@johto johto Expose quoteIdentifier
It's not possible to parameterize identifiers in PostgreSQL, so to
specify them dynamically one has to properly escape them before
interpolating them into the SQL string.  There's no reason to force
everyone to reinvent the wheel, so export our implementation.

Per discussion in #232.
@johto johto Make the common error messages more consistent
There are still several cases where the user could see an error not
prefixed with "pq: ", but there's no real reason why we couldn't fix
these instances.
Commits on Feb 13, 2014
@johto johto Don't allow zero bytes in the result of QuoteIdentifier
Because a protocol-level String is null-terminated, there would have
been a possibility of a specially crafted input string manipulating the
protocol packet.  However, the worst thing I can see is that the
attacker might be able to specify the input parameter types of a query
in a Parse message, which doesn't seem too problematic.
@johto johto Use strings.IndexRune instead of strings.IndexByte
IndexByte didn't exist pre-1.2.
Commits on Feb 16, 2014
@cyberdelia cyberdelia add support for connect_timeout parameter 9d56fa6
@johto johto Add Timothée Peignier to the list of contributors 4822f4f
@johto johto Gofmt conn.go b49f062
Commits on Feb 17, 2014
@johto johto Avoid concurrent use of the scratch buffer in copyin.Close
As noted in #235, previously both the Close() and the concurrently
running resploop could be trying to operate on the scratch buffer if a
message happened to arrive from the server just as we were sending the
CopyDone message.  Fix by bypassing the scratch buffer for CopyDone.
Commits on Feb 27, 2014
@johto johto Make connect_timeout apply to the entire connection procedure
As committed in 9d56fa6, only the TCP connection
establishment part was affected by the timeout.  The new behaviour is
more intuitive and matches that of libpq's.
@johto johto Improve comment about deadline in dial()
I accidentally wrote "timeout" when I meant "deadline", but I think this
is even better.
@johto johto Fix bug in dial() when connect_timeout is set
I completely broke this in commit 344cc71.
Commits on Mar 02, 2014
@cyberdelia cyberdelia gofmt 8f04589
@johto johto Add ErrorCode.Class()
This returns the "class" of an error, which supports Name() to get the
"condition name".
@johto johto Small editorialization of the error documentation a4953a8
@johto johto gofmt
Not sure I agree with this, but all glory to gofmt..
Commits on Mar 13, 2014
@johto johto Don't ignore the return value of SetDeadline()
It is possible that the runtime has already closed this connection from
underneath us and we would end up with a broken connection in the pool
(since we don't convert timeouts into ErrBadConns).  Fix simply by also
returning the error from Open(); we should not have to worry about
getting timeouts after Open() has succeeded.
Commits on Apr 14, 2014
@johto johto Build user_posix.go on Solaris
Per complaint from infolution.
Commits on Apr 27, 2014
@cmelbye merge upstream 46abf4a
Something went wrong with that request. Please try again.