[ANN] hpgsql, a pure Haskell PostgreSQL driver (no libpq)
Haskell Community [Unofficial]
May 13, 2026
That’s neat, and thanks!
As for thread safety, multiple threads sharing a connection will block until all results from previous queries/pipelines are fully consumed (or until a query errs), but there’s a bit more to it than that, like runPipeline requiring the same thread that sends a pipeline to be the thread that consumes the results of all the statements, and the streaming query/pipeline functions require the same thread that send the query/pipeline to be the thread that consumes the Stream fully (or until an error).
I thought these might be reasonable constraints, although I did try a more relaxed version of runPipeline’s constraints to begin with, but was unable to get something that didn’t run into deadlocks in some situations. I can get into more detail if you’re interested!
Discussion in the ATmosphere