Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12912 -- Placed the psycopg1-backed ``postgresql`` database ba…

…ckend on the deprecation path.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 156cdcf92decdf18a87a1229ba4ef8da1e6972ab 1 parent 6b2f125
Russell Keith-Magee authored February 23, 2010
6  django/db/backends/postgresql/base.py
@@ -102,6 +102,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
102 102
     def __init__(self, *args, **kwargs):
103 103
         super(DatabaseWrapper, self).__init__(*args, **kwargs)
104 104
 
  105
+        import warnings
  106
+        warnings.warn(
  107
+            'The ``postgres`` backend has been deprecated. Use ``postgres_psycopg2`` instead.',
  108
+            PendingDeprecationWarning
  109
+        )
  110
+
105 111
         self.features = DatabaseFeatures()
106 112
         self.ops = DatabaseOperations(self)
107 113
         self.client = DatabaseClient(self)
3  docs/internals/deprecation.txt
@@ -91,6 +91,9 @@ their deprecation, as per the :ref:`Django deprecation policy
91 91
           ``django.contrib.auth.context_processors.auth``.  This has been
92 92
           deprecated since the 1.2 release.
93 93
 
  94
+        * The ``postgresql`` database backend has been deprecated in favor of
  95
+          the ``postgresql_psycopg2`` backend.
  96
+
94 97
     * 2.0
95 98
         * ``django.views.defaults.shortcut()``. This function has been moved
96 99
           to ``django.contrib.contenttypes.views.shortcut()`` as part of the
12  docs/releases/1.2.txt
@@ -305,6 +305,18 @@ created using ``decorator_from_middleware``.
305 305
 Features deprecated in 1.2
306 306
 ==========================
307 307
 
  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
+
308 320
 CSRF response-rewriting middleware
309 321
 ----------------------------------
310 322
 

0 notes on commit 156cdcf

Please sign in to comment.
Something went wrong with that request. Please try again.