- version = cur.scalar(
- 'SELECT extversion FROM pg_extension WHERE extname = %s',
- ('hstore')
- )
-
- version_parts = version.split('.')
- if len(version_parts) < 2:
- raise UsageError(f"Error fetching hstore version. Bad format: {version}")
-
- return (int(version_parts[0]), int(version_parts[1]))
+ cur.execute('SELECT extname FROM pg_extension WHERE extname = %s', (extension_name, ))
+ return cur.rowcount > 0