postgresql-simple
postgresql-simple copied to clipboard
make automatic execution of SET commands right after connect optional
connectPostgreSQL executes several SET
commands automatically right after connecting to database:
let settings
| version < 80200 = "SET datestyle TO ISO;SET client_encoding TO UTF8"
| otherwise = "SET datestyle TO ISO;SET client_encoding TO UTF8;SET standard_conforming_strings TO on"
_ <- execute_ wconn settings
This prevents using postgresql-simple
for databases that support PostgreSQL protocol, but don't implement all of its features. For instance, connection to cockroachdb fails because it doesn't implement SET datestyle TO ISO
.
It would be nice to have an option to omit these SET
commands on connection creation.
Sounds reasonable to me. You can implement your own connect function via the Internal
module, but perhaps it would be better to have a way to do this via the public API? I don't know.
Well, even if we don't offer a way to do this via the public interface, we should ensure that there is a semi-standard and reasonably convenient way to implement this function using an Internal module