summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql_psycopg2/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #25175 -- Removed db.backends.postgresql_psycopg2 per deprecation timeline.Tim Graham2019-01-171-1/+0
|
* Refs #25175 -- Added backwards compatibility for importing ↵Caio Ariede2015-08-071-0/+1
| | | | postgresql_psycopg2 backend.
* Fixed #25175 -- Renamed the postgresql_psycopg2 database backend to postgresql.Caio Ariede2015-08-071-264/+0
|
* Well, what should I say: UPS.Florian Apolloner2015-05-241-1/+0
|
* Fixed #24844 -- Corrected has_changed implementation for HStoreField.Andrea Grandi2015-05-241-0/+1
|
* Fixed #23820 -- Supported per-database time zone.Aymeric Augustin2015-05-171-5/+3
| | | | | | | | | The primary use case is to interact with a third-party database (not primarily managed by Django) that doesn't support time zones and where datetimes are stored in local time when USE_TZ is True. Configuring a PostgreSQL database with the TIME_ZONE option while USE_TZ is False used to result in silent data corruption. Now this is an error.
* Fixed #24791 -- Added fallback when 'postgres' database isn't availableClaude Paroz2015-05-151-0/+26
| | | | Thanks Carl Meyer and Tim Graham for the reviews.
* Fixed #24335 -- Bumped required psycopg2 version to 2.4.5 (2.5 for ↵Tim Graham2015-02-161-26/+18
| | | | contrib.postgres).
* Removed 'autocommit' options for the psycopg2 backend.Aymeric Augustin2015-02-141-4/+1
| | | | It was documented as not having any effect since Django 1.6.
* Cleaned up init_connection_state in the psycopg2 backend.Aymeric Augustin2015-02-141-19/+18
| | | | settings_dict['TIME_ZONE'] is set in ConnectionHandler.ensure_defaults.
* Fixed #24318 -- Set the transaction isolation level with psycopg >= 2.4.2.Aymeric Augustin2015-02-141-5/+23
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-9/+9
|
* Removed PostgreSQL DatabaseWrapper._set_isolation_level().Tim Graham2015-01-311-7/+0
| | | | This method is unused since 8717b0668caf00ec5e81ef5a1e31b4d7c64eee8a.
* Fixed #24092 -- Widened base field support for ArrayField.Marc Tamlyn2015-01-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | Several issues resolved here, following from a report that a base_field of GenericIpAddressField was failing. We were using get_prep_value instead of get_db_prep_value in ArrayField which was bypassing any extra modifications to the value being made in the base field's get_db_prep_value. Changing this broke datetime support, so the postgres backend has gained the relevant operation methods to send dates/times/datetimes directly to the db backend instead of casting them to strings. Similarly, a new database feature has been added allowing the uuid to be passed directly to the backend, as we do with timedeltas. On the other side, psycopg2 expects an Inet() instance for IP address fields, so we add a value_to_db_ipaddress method to wrap the strings on postgres. We also have to manually add a database adapter to psycopg2, as we do not wish to use the built in adapter which would turn everything into Inet() instances. Thanks to smclenithan for the report.
* Fixed #22603 -- Reorganized classes in django.db.backends.Tim Graham2015-01-141-42/+12
|
* Moved DatabaseCreation.data_types properties to DatabaseWrapper.Tim Graham2014-12-311-0/+35
| | | | refs #22340.
* Fixed #24033 -- Use interval type on Oracle.Marc Tamlyn2014-12-231-0/+1
| | | | | | | | | | | Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review.
* Fixed #2443 -- Added DurationField.Marc Tamlyn2014-12-201-0/+1
| | | | | | | | | | | A field for storing periods of time - modeled in Python by timedelta. It is stored in the native interval data type on PostgreSQL and as a bigint of microseconds on other backends. Also includes significant changes to the internals of time related maths in expressions, including the removal of DateModifierNode. Thanks to Tim and Josh in particular for reviews.
* Fixed #23807 -- Ignored non-digits in psycopg2 versionAndriy Sokolovskiy2014-12-011-1/+1
|
* Fixed #16731 -- Made pattern lookups work properly with F() expressionsThomas Chaumeny2014-11-281-2/+15
|
* Added AutoField introspection for PostgreSQLClaude Paroz2014-11-201-0/+1
| | | | Refs #23748.
* Factorized schema_editor() at BaseDatabaseWrapper levelClaude Paroz2014-09-261-4/+1
|
* Fixed #19463 -- Added UUIDFieldMarc Tamlyn2014-09-161-0/+2
| | | | Uses native support in postgres, and char(32) on other backends.
* Fixed #23074 -- Avoided leaking savepoints in atomic.Aymeric Augustin2014-07-281-0/+1
| | | | Thanks Chow Loong Jin for the report and the initial patch.
* Added feature flags for introspection capabilities.Aymeric Augustin2014-05-081-0/+2
|
* Fixed #3214 -- Stopped parsing SQL with regex.Aymeric Augustin2014-04-261-0/+1
| | | | | | | | | | | | | | | | | | | | Avoided introducing a new regex-based SQL splitter in the migrations framework, before we're bound by backwards compatibility. Adapted this change to the legacy "initial SQL data" feature, even though it's already deprecated, in order to facilitate the transition to migrations. sqlparse becomes mandatory for RunSQL on some databases (all but PostgreSQL). There's no API to provide a single statement and tell Django not to attempt splitting. Since we have a more robust splitting implementation, that seems like a good tradeoff. It's easier to add a new keyword argument later if necessary than to remove one. Many people contributed to both tickets, thank you all, and especially Claude for the review. Refs #22401.
* Fixed flake8 warnings introduced in recent commits.Simon Charette2014-04-161-2/+0
|
* Fixed #21239 -- Maintained atomicity when closing the connection.Aymeric Augustin2014-04-101-23/+1
| | | | | Refs #15802 -- Reverted #7c657b24 as BaseDatabaseWrapper.close() now has a proper "finally" clause that may need to preserve self.connection.
* Fixed #22321 -- Wrapped exceptions in _set_autocommit.Aymeric Augustin2014-04-101-7/+8
| | | | Refs #21202.
* Fixed #21553 -- Ensured unusable database connections get closed.Aymeric Augustin2014-04-091-1/+1
|
* Removed legacy transaction management per the deprecation timeline.Aymeric Augustin2014-03-211-3/+0
|
* Ensure cursors are closed when no longer needed.Michael Manfre2014-02-021-2/+4
| | | | | | This commit touchs various parts of the code base and test framework. Any found usage of opening a cursor for the sake of initializing a connection has been replaced with 'ensure_connection()'.
* Fixed #16187 -- refactored ORM lookup systemAnssi Kääriäinen2014-01-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allowed users to specify which lookups or transforms ("nested lookus") are available for fields. The implementation is now class based. Squashed commit of the following: commit fa7a7195f1952a9c8dea7f6e89ee13f81757eda7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 18 10:53:24 2014 +0200 Added lookup registration API docs commit eb1c8ce164325e0d8641f14202e12486c70efdb6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Tue Jan 14 18:59:36 2014 +0200 Release notes and other minor docs changes commit 11501c29c9352d17f22f3a0f59d3b805913dedcc Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 20:53:03 2014 +0200 Forgot to add custom_lookups tests in prev commit commit 83173b960ea7eb2b24d573f326be59948df33536 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:59:12 2014 +0200 Renamed Extract -> Transform commit 3b18d9f3a1bcdd93280f79654eba0efa209377bd Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:51:53 2014 +0200 Removed suggestion of temporary lookup registration from docs commit 21d0c7631c161fc0c67911480be5d3f13f1afa68 Merge: 2509006 f2dc442 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 09:38:23 2014 -0800 Merge pull request #2 from mjtamlyn/lookups_3 Reworked custom lookups docs. commit f2dc4429a1da04c858364972eea57a35a868dab4 Author: Marc Tamlyn <marc.tamlyn@gmail.com> Date: Sun Jan 12 13:15:05 2014 +0000 Reworked custom lookups docs. Mostly just formatting and rewording, but also replaced the example using ``YearExtract`` to use an example which is unlikely to ever be possible directly in the ORM. commit 250900650628d1f11beadb22814abd666029fb81 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 13:19:13 2014 +0200 Removed unused import commit 4fba5dfaa022653ffa72497258ffd8f8b7476f92 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:34:41 2014 +0200 Added docs to index commit 6d53963f375c77a1f287833b19b976d23f36c30b Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:10:24 2014 +0200 Dead code removal commit f9cc0390078e21f1ea5a7bc1f15b09f8f6b0904d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 19:00:43 2014 +0200 A new try for docs commit 33aa18a6e3c831930bda0028222a26f9c1d96e66 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:57:12 2014 +0200 Renamed get_cols to get_group_by_cols commit c7d5f8661b7d364962bed2e6f81161c1b4f1bcc3 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:45:53 2014 +0200 Altered query string customization for backends vendors The new way is trying to call first method 'as_' + connection.vendor. If that doesn't exist, then call as_sql(). Also altered how lookup registration is done. There is now RegisterLookupMixin class that is used by Field, Extract and sql.Aggregate. This allows one to register lookups for extracts and aggregates in the same way lookup registration is done for fields. commit 90e7004ec14e15503f828cc9bde2a7dab593814d Merge: 66649ff f7c2c0a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:21:01 2014 +0200 Merge branch 'master' into lookups_3 commit 66649ff891c7c73c7eecf6038c9a6802611b5d8a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:16:01 2014 +0200 Some rewording in docs commit 31b8faa62714b4b6b6057a9f5cc106c4dd73caab Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 29 15:52:29 2013 +0200 Cleanup based on review comments commit 1016159f34674c0df871ed891cde72be8340bb5d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 18:37:04 2013 +0200 Proof-of-concept fix for #16731 Implemented only for SQLite and PostgreSQL, and only for startswith and istartswith lookups. commit 193cd097ca8f2cc6a911e57b8e3fb726f96ee6a6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 17:57:58 2013 +0200 Fixed #11722 -- iexact=F() produced invalid SQL commit 08ed3c3b49e100ed9019831e770c25c8f61b70f9 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:59:52 2013 +0200 Made Lookup and Extract available from django.db.models commit b99c8d83c972786c6fcd0e84c9e5cb08c1368300 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:06:29 2013 +0200 Fixed review notes by Loic commit 049eebc0703c151127f4f0265beceea7b8b39e72 Merge: ed8fab7 b80a835 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:53:10 2013 +0200 Merge branch 'master' into lookups_3 Conflicts: django/db/models/fields/__init__.py django/db/models/sql/compiler.py django/db/models/sql/query.py tests/null_queries/tests.py commit ed8fab7fe8867ff3eb801c3697a426478387bb2f Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:47:23 2013 +0200 Made Extracts aware of full lookup path commit 27a57b7aed91b2f346abc4a77da838bffa17c727 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:10:11 2013 +0200 Removed debugger import commit 074e0f5aca0572e368c11e6d2c73c9026e7d63d7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:02:16 2013 +0200 GIS lookup support added commit 760e28e72bae475b442b026650969b0d182dbe53 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 20:04:31 2013 +0200 Removed usage of Constraint, used Lookup instead commit eac47766844b90e7d3269e7a8c012eee34ec0093 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:22:30 2013 +0200 Minor cleanup of Lookup API commit 2adf50428d59a783078b0da3d5d035106640c899 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:14:19 2013 +0200 Added documentation, polished implementation commit 32c04357a87e3727a34f8c5e6ec0114d1fbbb303 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:10:15 2013 +0200 Avoid OrderedDict creation on lookup aggregate check commit 7c8b3a32cc17b4dbca160921d48125f1631e0df4 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:04:34 2013 +0200 Implemented nested lookups But there is no support of using lookups outside filtering yet. commit 4d219d4cdef21d9c14e5d6b9299d583d1975fcba Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Wed Nov 27 22:07:30 2013 +0200 Initial implementation of custom lookups
* Fixed #21453 -- Enabled autocommit before calling init_connection_state.Aymeric Augustin2014-01-121-5/+5
| | | | | | | Also ensured the transaction state is clean on Oracle while I was there. This change cannot be backported to 1.6 because it's backwards-incompatible for custom database backends.
* Fixed #21452 -- Non-autocommit connections to PostgreSQL.Aymeric Augustin2014-01-121-2/+2
| | | | | | | | | When settings.DATABASES['default']['AUTOCOMMIT'] = False, the connection wasn't in autocommit mode but Django pretended it was. Thanks Anssi for analysing this issue. Refs #17062.
* Fixed E124 pep8 warnings.Loic Bistuer2013-12-101-1/+2
|
* Fixed #16969 -- Don't connect to named database when possibleClaude Paroz2013-11-091-2/+3
| | | | | Thanks Andreas Pelme for the report and initial patch, and Aymeric Augustin, Shai Berger and Tim Graham for the reviews.
* Fixed #17671 - Cursors are now context managers.Michael Manfre2013-09-251-0/+2
|
* Fixed #20007 -- Configured psycopg2 to return UnicodeArraysEric Boersma2013-09-061-0/+1
| | | | Thanks hogbait for the report.
* Adding 'sqlmigrate' command and quote_parameter to support it.Andrew Godwin2013-09-061-2/+2
|
* Fixed test failure caused by different NULL ordering between backendsAnssi Kääriäinen2013-08-211-0/+1
|
* Merge branch 'master' into schema-alterationAndrew Godwin2013-07-221-2/+8
|\ | | | | | | | | | | | | | | | | Conflicts: django/db/backends/mysql/introspection.py django/db/backends/oracle/creation.py django/db/backends/postgresql_psycopg2/creation.py django/db/models/base.py django/db/models/loading.py
| * A large number of stylistic cleanups across django/db/Alex Gaynor2013-07-081-2/+8
| |
* | Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-06-281-2/+0
|\ \ | |/ | | | | | | | | | | Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py tests/field_deconstruction/tests.py
| * Removed several unused imports.Aymeric Augustin2013-06-191-2/+0
| |
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-04-181-117/+73
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: django/db/backends/__init__.py django/db/backends/mysql/base.py django/db/backends/oracle/base.py django/db/backends/oracle/creation.py django/db/backends/postgresql_psycopg2/base.py django/db/backends/sqlite3/base.py django/db/models/fields/related.py
| * Enabled database-level autocommit for all backends.Aymeric Augustin2013-03-111-1/+0
| | | | | | | | | | | | | | This is mostly a documentation change. It has the same backwards-incompatibility consequences as those described for PostgreSQL in a previous commit.
| * Removed _enter/_leave_transaction_management.Aymeric Augustin2013-03-111-17/+0
| | | | | | | | | | The goal is to make all databases share a common, autocommit-based, implementation.
| * Added BaseDatabaseWrapper.ensure_connection.Aymeric Augustin2013-03-111-4/+0
| | | | | | | | | | This API is useful because autocommit cannot be managed without an open connection.
| * Expressed the dirty flag handling logic in terms of autocommit.Aymeric Augustin2013-03-111-4/+0
| |