bmizerany/pq — pull request #33 by jgallagher (2012-07-28 21:39:00+00:00)
Title: Add support for LISTEN

This pull request adds a first stab at supporting LISTEN without breaking the database/sql API. I was playing with this in a cgo libpq wrapper; an example program that shows how this work is at

https://github.com/jgallagher/go-libpq/blob/master/examples/listen_notify.go

Basically, it detects a LISTEN query (based on the 'C' response from Postgres), and returns a different kind of row object in that case. The listenrows Next() method _blocks_ until a notification is received, then returns the notification message as a string as the only "column".