wai-session-postgresql is a wai-session plugin that stores session data in a postgresql database.
You can find the source code on hackage, stackage and on github.