v.18.16Improvement

New VersionInteger Metric Added to system.metrics Table in ClickHouse

The system.metrics table now has the VersionInteger metric, and system.build_options has the added line VERSION_INTEGER, which contains the numeric form of the ClickHouse version, such as 18016000. #3644
The system.metrics table now includes the VersionInteger metric, and the system.build_options table has a new entry VERSION_INTEGER that provides the ClickHouse version in numeric form.

Why it matters

This feature enables users to programmatically access and compare the ClickHouse version as an integer (e.g., 18016000), which simplifies version management, conditional queries, and automation tasks that depend on the server version.

How to use it

Query the system.metrics table to retrieve the VersionInteger metric or check the VERSION_INTEGER entry in system.build_options. For example, use the following SQL to get the version as an integer:

SELECT value FROM system.build_options WHERE name = 'VERSION_INTEGER'


or

SELECT value FROM system.metrics WHERE metric = 'VersionInteger'