Perhaps you can add the pl function, in my case I used python and distutils.version:
CREATE FUNCTION _is_major (a text, b text) RETURNS boolean AS $$ from distutils.version import LooseVersion return LooseVersion(a) > LooseVersion(b) $$ LANGUAGE PLPYTHONU;
You need the postgresql-plpython package.
source share