@@ -153,9 +153,13 @@ connectPostgreSQL connstr = do
153153 connectionHandle <- newMVar conn
154154 connectionObjects <- newMVar (IntMap.empty)
155155 let wconn = Connection{..}
156− _ <- execute_ wconn "SET standard_conforming_strings TO on;\
157− \SET datestyle TO ISO"
158− return Connection{..}
156+ version <- PQ.serverVersion conn
157+ let settings
158+ | version < 80200 = "SET datestyle TO ISO"
159+ | otherwise = "SET standard_conforming_strings TO on;\
160+ \SET datestyle TO ISO"
161+ _ <- execute_ wconn settings
162+ return wconn
159163 _ -> do
160164 msg <- maybe "connectPostgreSQL error" id <$> PQ.errorMessage conn
161165 throwIO $ SqlError { sqlNativeError = -1 -- FIXME?