1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/netbox/__init__.py
2017-10-11 16:16:44 -04:00

13 lines
432 B
Python

from distutils.version import StrictVersion
from django.db import connection
# NetBox v2.2 and later requires PostgreSQL 9.4 or higher
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
row = cursor.fetchone()
pg_version = row[0].split()[1]
if StrictVersion(pg_version) < StrictVersion('9.4.0'):
raise Exception("PostgreSQL 9.4.0 or higher is required. ({} found)".format(pg_version))