summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql_psycopg2/operations.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-240/+0
|
* Fixed #9596 -- Added date transform for DateTimeField.Jon Dufresne2015-06-021-12/+12
|
* Renamed value_to_db_xxx to adapt_xxxfield_value.Aymeric Augustin2015-05-171-4/+4
| | | | | This mirrors convert_xxxfield_value nicely, taking advantage of the adapter/converter terminology which is commonly used by DB-API modules.
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-251-1/+1
| | | | | | | | Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-2/+2
|
* Required sqlparse for SQL splitting per deprecation timeline.Tim Graham2015-01-171-1/+1
|
* Fixed #24092 -- Widened base field support for ArrayField.Marc Tamlyn2015-01-161-7/+21
| | | | | | | | | | | | | | | | | | | | | | 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-1/+1
|
* Fixed #24031 -- Added CASE expressions to the ORM.Michał Modzelewski2015-01-121-0/+12
|
* Removed db.backends methods which only call super().Tim Graham2014-12-301-2/+0
|
* Fixed #2443 -- Added DurationField.Marc Tamlyn2014-12-201-17/+0
| | | | | | | | | | | 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.
* Limited lines to 119 characters in django/Tim Graham2014-09-051-18/+26
| | | | refs #23395.
* Fixed #3214 -- Stopped parsing SQL with regex.Aymeric Augustin2014-04-261-0/+3
| | | | | | | | | | | | | | | | | | | | 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 #21844: Move quote_parameter off of Operations and renameAndrew Godwin2014-02-091-5/+0
|
* Fixed all E261 warningscoagulant2013-11-021-2/+2
|
* Adding 'sqlmigrate' command and quote_parameter to support it.Andrew Godwin2013-09-061-0/+5
|
* A large number of stylistic cleanups across django/db/Alex Gaynor2013-07-081-3/+3
|
* Fixed #20462 -- null/non-string regex lookups are now consistentAndrew Clark2013-06-261-1/+1
| | | | Thanks to noirbizarre for the report and initial patch.
* Added a stealth option to flush to allow cascades.Aymeric Augustin2013-06-101-5/+14
| | | | | | | | | This allows using flush on a subset of the tables without having to manually cascade to all tables with foreign keys to the tables being truncated, when they're known to be empty. On databases where truncate is implemented with DELETE FROM, this doesn't make a difference. The cascade is allowed, not mandatory.
* Fixed #11442 -- Postgresql backend casts all inet types to textErik Romijn2013-05-191-2/+2
|
* Fixed #19968 -- Dropped support for PostgreSQL < 8.4.Aymeric Augustin2013-03-181-15/+4
|
* Moved standard SQL for savepoints in the base backend.Aymeric Augustin2013-03-111-9/+0
| | | | These methods are only called when uses_savepoints = True anyway.
* Ensured a connection is established when checking the database version.Aymeric Augustin2013-02-191-2/+1
| | | | Fixed a test broken by 21765c0a. Refs #18135.
* Fixed #17260 -- Added time zone aware aggregation and lookups.Aymeric Augustin2013-02-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks Carl Meyer for the review. Squashed commit of the following: commit 4f290bdb60b7d8534abf4ca901bd0844612dcbda Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 21:21:30 2013 +0100 Used '0:00' instead of 'UTC' which doesn't always exist in Oracle. Thanks Ian Kelly for the suggestion. commit 01b6366f3ce67d57a58ca8f25e5be77911748638 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 13:38:43 2013 +0100 Made tzname a parameter of datetime_extract/trunc_sql. This is required to work around a bug in Oracle. commit 924a144ef8a80ba4daeeafbe9efaa826566e9d02 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 14:47:44 2013 +0100 Added support for parameters in SELECT clauses. commit b4351d2890cd1090d3ff2d203fe148937324c935 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 22:30:22 2013 +0100 Documented backwards incompatibilities in the two previous commits. commit 91ef84713c81bd455f559dacf790e586d08cacb9 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 09:42:31 2013 +0100 Used QuerySet.datetimes for the admin's date_hierarchy. commit 0d0de288a5210fa106cd4350961eb2006535cc5c Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 09:29:38 2013 +0100 Used QuerySet.datetimes in date-based generic views. commit 9c0859ff7c0b00734afe7fc15609d43d83215072 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:25 2013 +0100 Implemented QuerySet.datetimes on Oracle. commit 68ab511a4ffbd2b811bf5da174d47e4dd90f28fc Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:14 2013 +0100 Implemented QuerySet.datetimes on MySQL. commit 22d52681d347a8cdf568dc31ed032cbc61d049ef Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:42:29 2013 +0100 Implemented QuerySet.datetimes on SQLite. commit f6800fd04c93722b45f9236976389e0b2fe436f5 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:03 2013 +0100 Implemented QuerySet.datetimes on PostgreSQL. commit 0c829c23f4cf4d6804cadcc93032dd4c26b8c65e Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:41:08 2013 +0100 Added datetime-handling infrastructure in the ORM layers. commit 104d82a7778cf3f0f5d03dfa53709c26df45daad Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 10:05:55 2013 +0100 Updated null_queries tests to avoid clashing with the __second lookup. commit c01bbb32358201b3ac8cb4291ef87b7612a2b8e6 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 23:07:41 2013 +0100 Updated tests of .dates(). Replaced .dates() by .datetimes() for DateTimeFields. Replaced dates with datetimes in the expected output for DateFields. commit 50fb7a52462fecf0127b38e7f3df322aeb287c43 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:40:09 2013 +0100 Updated and added tests for QuerySet.datetimes. commit a8451a5004c437190e264667b1e6fb8acc3c1eeb Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 22:34:46 2013 +0100 Documented the new time lookups and updated the date lookups. commit 29413eab2bd1d5e004598900c0dadc0521bbf4d3 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 16:15:49 2013 +0100 Documented QuerySet.datetimes and updated QuerySet.dates.
* Fixed #18271 -- Changed stage at which TransactionTestCase flushes DB tables.Ramiro Morales2012-07-241-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, the flush was done before the test case execution and now it is performed after it. Other changes to the testing infrastructure include: * TransactionTestCase now doesn't reset autoincrement sequences either (previous behavior can achieved by using `reset_sequences`.) With this, no implicit such reset is performed by any of the provided TestCase classes. * New ordering of test cases: All unittest tes cases are run first and doctests are run at the end. THse changes could be backward-incompatible with test cases that relied on some kind of state being preserved between tests. Please read the relevant sections of the release notes and testing documentation for further details. Thanks Andreas Pelme for the initial patch. Karen Tracey and Anssi Kääriäinen for the feedback and Anssi for reviewing. This also fixes #12408.
* Fixed #18461 -- Ensured that last_executed_query returns UnicodeClaude Paroz2012-06-131-1/+3
| | | | Thanks Anssi Kääriäinen for the review.
* Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz2012-06-071-6/+8
| | | | | Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
* Fixed #17882 (again) -- Updated the database connections' time zone when ↵Aymeric Augustin2012-03-131-0/+3
| | | | | | time-zone-related settings are changed in tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added support for modifying the effect of ``DISTINCT`` clauses so theyRamiro Morales2011-12-221-0/+6
| | | | | | | | | | | | only consider some fields (PostgreSQL only). For this, the ``distinct()`` QuerySet method now accepts an optional list of model fields names and generates ``DISTINCT ON`` clauses on these cases. Thanks Jeffrey Gelens and Anssi Kääriäinen for their work. Fixes #6422. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12308 -- Added tablespace support to the PostgreSQL backend.Aymeric Augustin2011-10-141-0/+6
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@16987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7596. Added Model.objects.bulk_create, and make use of it in several ↵Alex Gaynor2011-09-091-0/+4
| | | | | | places. This provides a performance benefit when inserting multiple objects. THanks to Russ for the review, and Simon Meers for the MySQl implementation. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel2011-07-131-2/+0
| | | | | | the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #11065, #11285 -- Streamlined PostgreSQL version detection, fixing ↵Ramiro Morales2011-06-191-12/+3
| | | | | | | | | | | | | | | incompatibility with multi-db. Thanks findepi for the report. Changed our internal representation of the PostgreSQL version from tuples to integers as used by libpq and psycopg2. This simplifies version comparison operations. Also, using the associated libpq/psycopg2 API allows to remove the need for manually issuing in-band ``SELECT version()`` SQL queries to obtain the server version (or at least reduce its number if version of psycopg2 in use is older than 2.0.12). Refs #10509. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16255 -- Raised minimum PostgreSQL version supported to 8.2.Ramiro Morales2011-06-161-24/+7
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@16423 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14091 - be more correct about logging queries in connection.queries.Jacob Kaplan-Moss2011-04-221-3/+2
| | | | | | | Thanks to Aymeric Augustin for figuring out how to make this work across multiple databases. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13630 -- Made __init__ methods of all DB backends' DatabaseOperations ↵Ramiro Morales2011-04-051-2/+1
| | | | | | classes take a `connection` argument. Thanks calexium for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Deprecated the psycopg-based postgresql database backend.Russell Keith-Magee2011-04-021-0/+212
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15980 bcc190cf-cafb-0310-a4f2-bffc1f526a37