Skip to content

Commit 156cdcf

Browse files
committed
Fixed #12912 -- Placed the psycopg1-backed postgresql database backend on the deprecation path.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 6b2f125 commit 156cdcf

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

django/db/backends/postgresql/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
102102
def __init__(self, *args, **kwargs):
103103
super(DatabaseWrapper, self).__init__(*args, **kwargs)
104104

105+
import warnings
106+
warnings.warn(
107+
'The ``postgres`` backend has been deprecated. Use ``postgres_psycopg2`` instead.',
108+
PendingDeprecationWarning
109+
)
110+
105111
self.features = DatabaseFeatures()
106112
self.ops = DatabaseOperations(self)
107113
self.client = DatabaseClient(self)

docs/internals/deprecation.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ their deprecation, as per the :ref:`Django deprecation policy
9191
``django.contrib.auth.context_processors.auth``. This has been
9292
deprecated since the 1.2 release.
9393

94+
* The ``postgresql`` database backend has been deprecated in favor of
95+
the ``postgresql_psycopg2`` backend.
96+
9497
* 2.0
9598
* ``django.views.defaults.shortcut()``. This function has been moved
9699
to ``django.contrib.contenttypes.views.shortcut()`` as part of the

docs/releases/1.2.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,18 @@ created using ``decorator_from_middleware``.
305305
Features deprecated in 1.2
306306
==========================
307307

308+
``postgresql`` database backend
309+
-------------------------------
310+
311+
The ``psycopg1`` library has not been updated since October 2005. As a
312+
result, the ``postgresql`` database backend, which depends on this
313+
library, has been deprecated.
314+
315+
If you are currently using the ``postgresql`` backend, you should
316+
migrate to using the ``postgresql_psycopg2`` backend. To update your
317+
code, install the ``psycopg2`` library and change the
318+
``DATABASE_ENGINE`` setting to read ``postgresql_psycopg2``.
319+
308320
CSRF response-rewriting middleware
309321
----------------------------------
310322

0 commit comments

Comments
 (0)