Skip to content

Commit 0fa2f56

Browse files
taimoorzaeemsteve-chavez
authored andcommitted
fix: misleading logs on unsupported postgresql versions
Postgrest fails on unsupported pg versions. However before killing the thread, it continues to print a few more log messages which were misleading. This commit fixes this by making sure that the no log message should be printed after the unsupported pg version observation and kill the thread immediately. Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
1 parent 24a27d1 commit 0fa2f56

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. From versio
44

55
## Unreleased
66

7+
### Fixed
8+
9+
- Fix misleading logs on unsupported PostgreSQL versions by @taimoorzaeem in #4519
10+
711
## [14.1] - 2025-11-05
812

913
## Fixed

src/PostgREST/AppState.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,16 @@ retryingSchemaCacheLoad appState@AppState{stateObserver=observer, stateMainThrea
382382
observer ExitDBNoRecoveryObs
383383
killThread mainThreadId
384384
return Nothing
385-
Right actualPgVersion -> do
386-
when (actualPgVersion < minimumPgVersion) $ do
385+
Right actualPgVersion ->
386+
if actualPgVersion < minimumPgVersion then do
387387
observer $ ExitUnsupportedPgVersion actualPgVersion minimumPgVersion
388388
killThread mainThreadId
389-
observer $ DBConnectedObs $ pgvFullName actualPgVersion
390-
observer $ PoolInit configDbPoolSize
391-
putPgVersion appState actualPgVersion
392-
return $ Just actualPgVersion
389+
return Nothing
390+
else do
391+
observer $ DBConnectedObs $ pgvFullName actualPgVersion
392+
observer $ PoolInit configDbPoolSize
393+
putPgVersion appState actualPgVersion
394+
return $ Just actualPgVersion
393395

394396
qInDbConfig :: IO ()
395397
qInDbConfig = do

0 commit comments

Comments
 (0)