Parameter · Preset Options
server_version_num
Shows the server version as an integer.
- Default:
180006 - Type: integer
- Range: 180006 … 180006
- Applies: Read-only
In plain words
The same version as a number: major × 10000 + minor. For PostgreSQL 18.6 that is 180006. Scripts and extensions compare it instead of parsing text.
For DBAs and operators
SELECT current_setting('server_version_num')::int >= 180000 AS is_pg18_or_later;Since PostgreSQL 10 the format is MMmmmm (major × 10000 + minor). Before 10 it was MMmmpp (e.g. 90624 for 9.6.24).
How to change it
Fixed when PostgreSQL was built or the cluster was initialised. You can only read it.