feat(server): check PG version before running migrations #1868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To avoid more dupes of #1860, exit the server with a relevant error when PG is outdated.
This is pulling the
server_version_num
info (you can manually get it with aSHOW server_version_num;
query). It's value ismajor * 10000 + minor
, so 160002 for version 16.2. This could allow you to also check the minor version in the future if needed.Tested
Server still starts fine with PG 15.
Checks
The generated errors are not pretty, feel free to change them.