cut, awk, head, bash, etc are easy enough, but am I overlooking some intrinsic method of getting just PG's primary version number (9.6 or 14, in my case) without doing substring manipulation?
If you're logging into the database, I prefer getting the number value like this when using it for comparisons. Still need to do some manipulation if you just want the major version, but it's a lot easier to work with than the strings you were getting with other methods.