diff --git a/django/db/backends/postgresql/version.py b/django/db/backends/postgresql/version.py index e14d791b07..ed2ad9e441 100644 --- a/django/db/backends/postgresql/version.py +++ b/django/db/backends/postgresql/version.py @@ -4,7 +4,12 @@ Extracts the version of the PostgreSQL server. import re -VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\.') +# This reg-exp is intentionally fairly flexible here. Require only the major +# and minor version numbers, but need to be able to handle standard stuff like: +# PostgreSQL 8.3.6 +# EnterpriseDB 8.3 +# PostgreSQL 8.3 beta4 +VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)') def get_version(cursor): """