Skip to content

Commit

Permalink
Do not include SET ROLE and SELECT pg_backend_pid in the statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak committed Mar 8, 2024
1 parent 498b34f commit a37d44a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Database/PostgreSQL/PQTypes/Internal/Connection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ connect ConnectionSettings {..} = mask $ \unmask -> do
(_, res) <- runQueryIO conn selectPid
case F.toList $ mkQueryResult @(Identity Int32) selectPid noBackendPid res of
[pid] -> withConnectionData conn fname $ \cd -> do
pure (cd {cdBackendPid = BackendPid $ fromIntegral pid}, ())
pure
( cd
{ cdBackendPid = BackendPid $ fromIntegral pid
, cdStats = initialStats -- Statistics are for user queries.
}
, ()
)
pids -> do
let err = HPQTypesError $ "unexpected backend pid: " ++ show pids
rethrowWithContext selectPid noBackendPid $ toException err
Expand Down

0 comments on commit a37d44a

Please sign in to comment.