diff --git a/CHANGELOG.md b/CHANGELOG.md index dc5ed5f25..aa9363bdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. From versio ## Unreleased +### Fixed + +- Fix misleading logs on unsupported PostgreSQL versions by @taimoorzaeem in #4519 + ## [14.1] - 2025-11-05 ## Fixed diff --git a/src/PostgREST/AppState.hs b/src/PostgREST/AppState.hs index a2ac5862a..f231a4e9a 100644 --- a/src/PostgREST/AppState.hs +++ b/src/PostgREST/AppState.hs @@ -382,14 +382,16 @@ retryingSchemaCacheLoad appState@AppState{stateObserver=observer, stateMainThrea observer ExitDBNoRecoveryObs killThread mainThreadId return Nothing - Right actualPgVersion -> do - when (actualPgVersion < minimumPgVersion) $ do + Right actualPgVersion -> + if actualPgVersion < minimumPgVersion then do observer $ ExitUnsupportedPgVersion actualPgVersion minimumPgVersion killThread mainThreadId - observer $ DBConnectedObs $ pgvFullName actualPgVersion - observer $ PoolInit configDbPoolSize - putPgVersion appState actualPgVersion - return $ Just actualPgVersion + return Nothing + else do + observer $ DBConnectedObs $ pgvFullName actualPgVersion + observer $ PoolInit configDbPoolSize + putPgVersion appState actualPgVersion + return $ Just actualPgVersion qInDbConfig :: IO () qInDbConfig = do