FindPostgreSQL: support version encoding used in pre-10 releases

With the 10.x release, PostgreSQL upstream started encoding the version
as `MMmmmm` where `M` is major and `m` is minor. Prior to that, `MMmmPP`
was used where `P` was the patch number. Detect this difference and
decode it based on the used encoding.

Fixes: #19912
2 files changed