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
This commit is contained in:
Russell Keith-Magee 2010-02-23 12:24:41 +00:00
parent 6b2f125b80
commit 156cdcf92d
3 changed files with 21 additions and 0 deletions

View File

@ -102,6 +102,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DatabaseWrapper, self).__init__(*args, **kwargs) super(DatabaseWrapper, self).__init__(*args, **kwargs)
import warnings
warnings.warn(
'The ``postgres`` backend has been deprecated. Use ``postgres_psycopg2`` instead.',
PendingDeprecationWarning
)
self.features = DatabaseFeatures() self.features = DatabaseFeatures()
self.ops = DatabaseOperations(self) self.ops = DatabaseOperations(self)
self.client = DatabaseClient(self) self.client = DatabaseClient(self)

View File

@ -91,6 +91,9 @@ their deprecation, as per the :ref:`Django deprecation policy
``django.contrib.auth.context_processors.auth``. This has been ``django.contrib.auth.context_processors.auth``. This has been
deprecated since the 1.2 release. deprecated since the 1.2 release.
* The ``postgresql`` database backend has been deprecated in favor of
the ``postgresql_psycopg2`` backend.
* 2.0 * 2.0
* ``django.views.defaults.shortcut()``. This function has been moved * ``django.views.defaults.shortcut()``. This function has been moved
to ``django.contrib.contenttypes.views.shortcut()`` as part of the to ``django.contrib.contenttypes.views.shortcut()`` as part of the

View File

@ -305,6 +305,18 @@ created using ``decorator_from_middleware``.
Features deprecated in 1.2 Features deprecated in 1.2
========================== ==========================
``postgresql`` database backend
-------------------------------
The ``psycopg1`` library has not been updated since October 2005. As a
result, the ``postgresql`` database backend, which depends on this
library, has been deprecated.
If you are currently using the ``postgresql`` backend, you should
migrate to using the ``postgresql_psycopg2`` backend. To update your
code, install the ``psycopg2`` library and change the
``DATABASE_ENGINE`` setting to read ``postgresql_psycopg2``.
CSRF response-rewriting middleware CSRF response-rewriting middleware
---------------------------------- ----------------------------------