Skip to content

Conversation

@taimoorzaeem
Copy link
Collaborator

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.

Closes #4519.

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 <[email protected]>
Copy link
Member

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test, but diff LGTM.

@taimoorzaeem
Copy link
Collaborator Author

I forgot to mention that I tested this locally/manually and it works fine 👍. I couldn't figure out an automated way to test this.

Copy link
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍

I manually tested it by modifying the minimum pg version to 15:

minimumPgVersion :: PgVersion
minimumPgVersion = pgVersion130

Then on this branch:

$ PGRST_SERVER_TIMING_ENABLED=true postgrest-with-pg-14 -f test/spec/fixtures/load.sql postgrest-run
postgrest-with-pg-14: You can connect with: psql 'postgres:///postgres?host=/tmp/nix-shell-443225-0/postgrest-with-pg-14-uH5/socket' -U postgres
postgrest-with-pg-14: You can tail the logs with: tail -f /tmp/nix-shell-443225-0/postgrest-with-pg-14-uH5/db.log
09/Dec/2025:13:43:45 -0500: Starting PostgREST 15 (pre-release)...
09/Dec/2025:13:43:45 -0500: Admin server listening on 0.0.0.0:3001
09/Dec/2025:13:43:45 -0500: API server listening on 0.0.0.0:3000
09/Dec/2025:13:43:45 -0500: Listening for database notifications on the "pgrst" channel
09/Dec/2025:13:43:45 -0500: Cannot run in this PostgreSQL version (14.18), PostgREST needs at least 15.0
postgrest: thread killed

Master branch shows the same logs as #4519.

@steve-chavez steve-chavez merged commit 0fa2f56 into PostgREST:main Dec 9, 2025
31 of 32 checks passed
@taimoorzaeem taimoorzaeem deleted the fix/misleading-logs branch December 9, 2025 18:53
@postgrest-ci
Copy link

postgrest-ci bot commented Dec 10, 2025

Successfully created backport PR for v14:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Misleading logs on unsupported PostgreSQL version

3 participants