v.18.16Improvement
New VersionInteger Metric Added to system.metrics Table in ClickHouse
Thesystem.metricstable now has theVersionIntegermetric, andsystem.build_optionshas the added lineVERSION_INTEGER, which contains the numeric form of the ClickHouse version, such as18016000. #3644
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 thesystem.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'