View definition


Defined in


Listen starts listening for notifications on a channel. Calls to this function will block until an acknowledgement has been received from the server. Note that Listener automatically re-establishes the connection after connection loss, so this function may block indefinitely if the connection can not be re-established.

Listen will only fail in three conditions:

1) The channel is already open.  The returned error will be
2) The query was executed on the remote server, but PostgreSQL returned an
   error message in response to the query.  The returned error will be a
   pq.Error containing the information the server supplied.
3) Close is called on the Listener before the request could be completed.

The channel name is case-sensitive.

Listen is referenced in 10 repositories