Ticket #10476: remove_unnecessary_test_v2.diff

File remove_unnecessary_test_v2.diff, 2.1 KB (added by Richard Davies <richard.davies@…>, 6 years ago)

Wider clean up of tests in this area

  • django/db/backends/postgresql_psycopg2/base.py

     
    108108            if self._version[0:2] < (8, 0):
    109109                # No savepoint support for earlier version of PostgreSQL.
    110110                self.features.uses_savepoints = False
    111             if self.features.uses_autocommit:
    112                 if self._version[0:2] < (8, 2):
    113                     # FIXME: Needs extra code to do reliable model insert
    114                     # handling, so we forbid it for now.
    115                     from django.core.exceptions import ImproperlyConfigured
    116                     raise ImproperlyConfigured("You cannot use autocommit=True with PostgreSQL prior to 8.2 at the moment.")
    117                 else:
    118                     # FIXME: Eventually we're enable this by default for
    119                     # versions that support it, but, right now, that's hard to
    120                     # do without breaking other things (#10509).
    121                     self.features.can_return_id_from_insert = True
     111            if self._version[0:2] >= (8, 2):
     112                # FIXME: Eventually we'll enable this by default for
     113                # versions that support it, but, right now, that's hard to
     114                # do without breaking other things (#10509).
     115                self.features.can_return_id_from_insert = True
    122116        return cursor
    123117
    124118    def _enter_transaction_management(self, managed):
  • docs/topics/db/transactions.txt

     
    283283
    284284.. versionadded:: 1.1
    285285
    286 With PostgreSQL 8.2 or later, there is an advanced option to run PostgreSQL
     286There is an advanced option to run PostgreSQL
    287287with :ref:`database-level autocommit <ref-databases>`. If you use this option,
    288288there is no constantly open transaction, so it is always possible to continue
    289289after catching an exception. For example::
Back to Top