summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #470 -- Added support for database defaults on fields.Ian Foote2023-05-121-0/+1
| | | | | | | | Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
* Fixed #34553 -- Fixed improper % escaping of literal in constraints.Simon Charette2023-05-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Proper escaping of % in string literals used when defining constaints was attempted (a8b3f96f6) by overriding quote_value of Postgres and Oracle schema editor. The same approach was used when adding support for constraints to the MySQL/MariaDB backend (1fc2c70). Later on it was discovered that this approach was not appropriate and that a preferable one was to pass params=None when executing the constraint creation DDL to avoid any form of interpolation in the first place (42e8cf47). When the second patch was applied the corrective of the first were not removed which caused % literals to be unnecessary doubled. This flew under the radar because the existings test were crafted in a way that consecutive %% didn't catch regressions. This commit introduces an extra test for __exact lookups which highlights more adequately % doubling problems but also adjust a previous __endswith test to cover % doubling problems (%\% -> %%\%%). Thanks Thomas Kolar for the report. Refs #32369, #30408, #30593.
* Fixed #34544 -- Avoided DBMS_LOB.SUBSTR() wrapping with IS NULL condition on ↵Mariusz Felisiak2023-05-081-0/+3
| | | | | | | | | Oracle. Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca. Thanks Michael Smith for the report. This also reverts commit 1e4da439556cdd69eb9f91e07f99cf77997e70d2.
* Fixed #34505 -- Skipped varchar_pattern_ops/text_pattern_ops index creation ↵Petter Friberg2023-04-211-1/+3
| | | | when db_collation is set in related field.
* Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation ↵David Wobrock2023-04-181-0/+11
| | | | relation on PostgreSQL.
* Fixed #34486 -- Fixed DatabaseOperations.compose_sql() crash with no ↵Scott Macpherson2023-04-141-1/+2
| | | | | | existing database connection on PostgreSQL. Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
* Fixed #34470 -- Enforced UTF-8 encoding on PostgreSQL.Mariusz Felisiak2023-04-071-1/+1
| | | Regression in 6a2165816394ab4bb259f6171e82417e098e97a6.
* Fixed #34466 -- Reallowed setting cursor_factory in DATABASES["options"] on ↵Anders Kaseorg2023-04-071-9/+8
| | | | | | PostgreSQL. Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
* Prevented PostgreSQL's DatabaseCreation._execute_create_test_db() from ↵Tim Graham2023-04-031-2/+1
| | | | | hiding clause-less exceptions. Regression in 3cafb783f3f711c7413ba2b8d7c8ff750bd4d6e1.
* Made PostgreSQL's SchemaEditor._create_index_sql() respect the "sql" argument.Dan Glass2023-02-061-1/+1
|
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-012-2/+0
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Refs #34255 -- Skipped test_group_by_nested_expression_with_params test on ↵Mariusz Felisiak2023-01-271-0/+20
| | | | | PostgreSQL when server-side binding cursors are used. Thanks Tim Graham for the review.
* Fixed #34255 -- Made PostgreSQL backend use client-side parameters binding ↵Mariusz Felisiak2023-01-171-3/+16
| | | | | | | | with psycopg version 3. Thanks Guillaume Andreu Sabater for the report. Co-authored-by: Florian Apolloner <apollo13@users.noreply.github.com>
* Refs #34255 -- Bumped required psycopg version to 3.1.8.Mariusz Felisiak2023-01-171-3/+3
|
* Refs #18468 -- Used obj_description() with a catalog name on PostgreSQL.Mariusz Felisiak2023-01-121-1/+1
| | | | | | | obj_description(object oid) without a catalog name is deprecated since there is no guarantee that OIDs are unique across different system catalogs. Thanks Tim Graham for the report.
* Fixed #34200 -- Made the session role configurable on PostgreSQL.Mike Crute2023-01-031-5/+20
|
* Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.Adrian Torres2022-12-282-1/+8
| | | | Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #18468 -- Added support for comments on columns and tables.kimsoungryoul2022-12-282-4/+8
| | | | | | | | Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz Felisiak for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
* Fixed #34219 -- Preserved Char/TextField.db_collation when altering column type.Mariusz Felisiak2022-12-221-5/+12
| | | | | | | This moves setting a database collation to the column type alteration as both must be set at the same time. This should also avoid another layer of the column type alteration when adding database comments support (#18468).
* Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo2022-12-155-93/+291
| | | | | | | Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL.Florian Apolloner2022-12-122-1/+9
|
* Refs #33308 -- Added psycopg_any.IsolationLevel.Florian Apolloner2022-12-122-6/+24
|
* Refs #33308 -- Added psycopg_any.sql.quote() hook.Florian Apolloner2022-12-122-7/+14
|
* Refs #33308 -- Moved psycopg2 imports to the psycopg_any module.Florian Apolloner2022-12-124-8/+10
|
* Made inspectdb used Cursor.description.display_size for CharFields' max_length.Mariusz Felisiak2022-12-081-1/+2
| | | internal_size is size for fixed-size types not for char types.
* Refs #33308 -- Modernized database wrapper in the PostgreSQL backend.Florian Apolloner2022-12-061-6/+5
| | | | | | | | | - Used connection.info instead of connection.get_parameter_status() and connection.server_info which don't exist in psycopg 3. - Set encoding using the client_encoding connection parameter instead of connection.set_client_encoding() that doesn't exist in psycopg 3. - Used the dbname connection parameter instead of deprecated alias - database.
* Refs #33308 -- Used psycopg's errors instead of errorcodes.Florian Apolloner2022-12-011-2/+3
|
* Refs #33308 -- Used get_db_prep_value() to adapt JSONFields.Simon Charette2022-11-151-0/+14
|
* Refs #34058 -- Fixed changing/deleting sequences when altering pre-Django ↵Mariusz Felisiak2022-10-011-25/+36
| | | | | | | | 4.1 auto fields on PostgreSQL. Thanks Anders Kaseorg for the report. Follow up to 19e6efa50b603af325e7f62058364f278596758f. Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
* Fixed #34058 -- Changed sequence types when altering pre-Django 4.1 auto ↵Mariusz Felisiak2022-09-291-1/+24
| | | | | | | | | fields on PostgreSQL. Thanks Anders Kaseorg for the report. Thanks Florian Apolloner for pair programming. Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
* Fixed #34027 -- Fixed migrations crash when altering type of char/text ↵David Sanders2022-09-251-12/+14
| | | | fields referenced by foreign key on PostgreSQL.
* Fixed #33932 -- Fixed altering AutoFields to OneToOneField on PostgreSQL.Benoît Vinot2022-08-171-1/+1
| | | | Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
* Fixed #33901 -- Skipped varchar_pattern_ops/text_pattern_ops index creation ↵Haolun Chai2022-08-151-0/+4
| | | | when db_collation is set.
* Fixed #33872 -- Deprecated ↵Mariusz Felisiak2022-08-031-0/+1
| | | | django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField.
* Fixed #33881 -- Added support for database collations to ↵Mariusz Felisiak2022-08-021-4/+30
| | | | ArrayField(Char/TextFields).
* Fixed #33854 -- Corrected the order of parameters in dbshell on PostgreSQL.Jarrett Keifer2022-07-181-1/+1
|
* Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette2022-07-061-34/+40
| | | | Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #32234 -- Made inspectdb inform about composite primary keys.Anv3sh2022-06-011-0/+7
|
* Fixed #33717 -- Dropped support for PostgreSQL 11.Mariusz Felisiak2022-05-191-9/+1
|
* Refs #27064 -- Added RenameIndex migration operation.David Wobrock2022-05-121-0/+1
|
* Fixed #25105 -- Checked deferred constraints before updating rows on PostgreSQL.David Wobrock2022-05-041-0/+7
|
* Fixed #33675 -- Dropped support for PostgreSQL 10 and PostGIS 2.4.Mariusz Felisiak2022-05-041-7/+2
|
* Removed unneeded code in explain_query_prefix()Tim Graham2022-04-141-1/+1
|
* Fixed #30511 -- Used identity columns instead of serials on PostgreSQL.Florian Apolloner2022-04-133-82/+66
|
* Fixed CVE-2022-28347 -- Protected QuerySet.explain(**options) against SQL ↵Mariusz Felisiak2022-04-112-9/+23
| | | | injection on PostgreSQL.
* Refs #33517 -- Prevented __second lookup from returning fractional seconds ↵nabil-rady2022-02-221-0/+9
| | | | on PostgreSQL.
* Fixed #33379 -- Added minimum database version checks.Hasan Ramezani2022-02-182-0/+9
| | | | Thanks Tim Graham for the review.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-074-20/+49
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-077-328/+499
|
* Fixed #31685 -- Added support for updating conflicts to QuerySet.bulk_create().sean_c_hsu2022-01-192-2/+17
| | | | | Thanks Florian Apolloner, Chris Jerdonek, Hannes Ljungberg, Nick Pope, and Mariusz Felisiak for reviews.