'Returns the PostGIS version as a tuple (version string, major,
minor, subminor).'

def postgis_version_tuple(self):

    version = self.postgis_lib_version()
    m = self.version_regex.match(version)
    if m:
        major = int(m.group('major'))
        minor1 = int(m.group('minor1'))
        minor2 = int(m.group('minor2'))
    else:
        raise Exception(('Could    not    parse    PostGIS    version    string:    %s' % version))
    return (version, major, minor1, minor2)
