diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index c40a67b2e15..df5f37b43ab 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -32,8 +32,8 @@ def psycopg2_version(): PSYCOPG2_VERSION = psycopg2_version() -if PSYCOPG2_VERSION < (2, 4, 5): - raise ImproperlyConfigured("psycopg2_version 2.4.5 or newer is required; you have %s" % psycopg2.__version__) +if PSYCOPG2_VERSION < (2, 5, 4): + raise ImproperlyConfigured("psycopg2_version 2.5.4 or newer is required; you have %s" % psycopg2.__version__) # Some of these import psycopg2, so import them after checking if it's installed. diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt index cfce65420fa..f384f5829cf 100644 --- a/docs/ref/contrib/postgres/fields.txt +++ b/docs/ref/contrib/postgres/fields.txt @@ -517,7 +517,7 @@ using in conjunction with lookups on of the JSON which allows indexing. The trade-off is a small additional cost on writing to the ``jsonb`` field. ``JSONField`` uses ``jsonb``. - **As a result, this field requires PostgreSQL ≥ 9.4 and Psycopg2 ≥ 2.5.4**. + **As a result, this field requires PostgreSQL ≥ 9.4**. Querying ``JSONField`` ---------------------- diff --git a/docs/ref/contrib/postgres/index.txt b/docs/ref/contrib/postgres/index.txt index 5a212fbdcd4..9485f56409c 100644 --- a/docs/ref/contrib/postgres/index.txt +++ b/docs/ref/contrib/postgres/index.txt @@ -9,9 +9,6 @@ PostgreSQL has a number of features which are not shared by the other databases Django supports. This optional module contains model fields and form fields for a number of PostgreSQL specific data types. -Psycopg2 2.5 or higher is required, though we highly recommend using the latest -release. Some fields require higher versions. - .. note:: Django is, and will continue to be, a database-agnostic web framework. We would encourage those writing reusable applications for the Django diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 8032c36045f..cf2f924dd76 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -92,8 +92,8 @@ below for information on how to set up your database correctly. PostgreSQL notes ================ -Django supports PostgreSQL 9.3 and higher. It requires the use of `psycopg2`_ -2.4.5 or higher (or 2.5+ if you want to use :mod:`django.contrib.postgres`). +Django supports PostgreSQL 9.3 and higher. `psycopg2`_ 2.5.4 or higher is +required, though the latest release is recommended. .. _psycopg2: http://initd.org/psycopg/ diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt index 9a340de0dd7..c7181e57f94 100644 --- a/docs/releases/1.11.txt +++ b/docs/releases/1.11.txt @@ -521,6 +521,9 @@ Django 1.11 sets PostgreSQL 9.3 as the minimum version it officially supports. Support for PostGIS 2.0 is also removed as PostgreSQL 9.2 is the last version to support it. +Also, the minimum supported version of psycopg2 is increased from 2.4.5 to +2.5.4. + ``LiveServerTestCase`` binds to port zero ----------------------------------------- diff --git a/tests/requirements/postgres.txt b/tests/requirements/postgres.txt index 4ff5f170a9c..59041b90ef0 100644 --- a/tests/requirements/postgres.txt +++ b/tests/requirements/postgres.txt @@ -1 +1 @@ -psycopg2>=2.5 +psycopg2>=2.5.4