I was a little confused when I read the documentation of
getNotification and saw that it didn't take what channel to listen on
as an argument - having just read the PostgreSQL documentation of
NOTIFY channel +
LISTEN channel that was what I was expecting.
After some digging I found a test for the
and from that saw that the way to use D.P.S.Notification is to execute
one or more
LISTEN channel before calling
In hindsight it is obvious (you want to be able to listen to multiple
channels in the same
getNotification call), but to me, as a relative
beginner in Haskell and using postgresql-simple, and never having tried
LISTEN/NOTIFY before, it wasn't.
I have written to the maintainer and suggested that the documentation of D.P.S.Notification mention this.
One thing I miss in the documentation of many Haskell libraries is a couple of lines giving an example of how to use them - luckily I found the solution in a test this time.