summaryrefslogtreecommitdiff
path: root/django/contrib/postgres
AgeCommit message (Collapse)Author
14 daysFixed #37028 -- Added BitAnd(), BitOr(), and BitXor() aggregates.Mariusz Felisiak
2026-03-24Fixed #36985 -- Skipped CreateExtension backwards operation on ↵varunkasyap
non-PostgreSQL databases.
2026-03-12Fixed #36727 -- Deprecated Field.get_placeholder in favor of ↵Simon Charette
get_placeholder_sql. The lack of ability of the get_placeholder call chain to return SQL and parameters separated so they can be mogrified by the backend at execution time forced implementations to dangerously interpolate potentially user controlled values. The get_placeholder_sql name was chosen due to its proximity to the previous method, but other options such as Field.as_sql were considered but ultimately rejected due to its different input signature compared to Expression.as_sql that might have lead to confusion. There is a lot of overlap between what Field.get_db_prep_value and get_placeholder_sql do but folding the latter in the former would require changing its return signature to return expression which is a way more invasive change than what is proposed here. Given we always call get_db_prep_value it might still be an avenue worth exploring in the future to offer a publicly documented interface to allow field to take an active part in the compilation chain. Thanks Jacob for the review.
2026-01-10Fixed #36827 -- Added support for exclusion constraints using Hash indexes ↵Haki Benita
on PostgreSQL.
2026-01-08Fixed #36852 -- Ignored index_type case in ExclusionConstraint equality check.Haki Benita
2025-12-02Updated translations from Transifex.Natalia
Forwardport of 00575b79312c719a6b37035067095e2d679bb5d7 from stable/6.0.x.
2025-12-02Refs #35444 -- Fixed typo in PostgreSQL StringAgg deprecation warning.Νικόλαος-Διγενής Καραγιάννης
2025-11-14Refs #24928 -- Added introspection support for PostgreSQL HStoreField.Mariusz Felisiak
2025-11-13Refs #31055 -- Adjusted passing of Field.check kwargs to ArrayField.base_field.Simon Charette
This was missed when Field.check(databases) was introduced.
2025-10-29Refs #35381 -- Delegated ArrayField element prepping to ↵Clifford Gama
base_field.get_db_prep_save. Previously, ArrayField always used base_field.get_db_prep_value when saving, which could differ from how base_field prepares data for save. This change overrides ArrayField.get_db_prep_save to delegate to the base_field's get_db_prep_save, ensuring elements like None in JSONField arrays are saved correctly as SQL NULL instead of JSON null.
2025-10-13Replaced multi-level relative imports with absolute imports in django/.lyova24
2025-09-18Updated translations from Transifex.Natalia
Forwardport of 2a2936c3e6444a0f37156773ca405cedaf28dea7 from stable/5.2.x.
2025-09-17Refs #35444 -- Removed contrib.postgres aggregates ordering kwarg per ↵Jacob Walls
deprecation timeline.
2025-09-16Fixed #28041 -- Added Lexeme expression to contrib.postgres.search.GappleBee
This expression automatically escapes its input and allows fine-grained control over prefix matching and term weighting via logical combinations. Thanks Mariusz Felisiak, Adam Zapletal, Paolo Melchiorre, Jacob Walls, Adam Johnson, and Simon Charette for reviews. Co-authored-by: joetsoi <joetsoi@users.noreply.github.com> Co-authored-by: Karl Hobley <karl@kaed.uk> Co-authored-by: Alexandr Tatarinov <tatarinov1997@gmail.com>
2025-08-04Fixed #35972 -- Fixed lookup crashes after subquery annotations.Jacob Walls
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-22Fixed #36377 -- Added hints support to CreateExtension and subclasses.Anthony Sottile
2025-06-18Fixed #32770 -- Added system check to ensure django.contrib.postgres is ↵Clifford Gama
installed when using its features. Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS when using: * PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField), * PostgreSQL indexes (PostgresIndex and all subclasses), and * ExclusionConstraint The check provides immediate feedback during system checks rather than failing later with obscure runtime and database errors. Thanks to Simon Charette and Sarah Boyce for reviews.
2025-04-16Americanized some spellings.Adam Johnson
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2025-03-31Updated translations from Transifex.Sarah Boyce
Forwardport of cc31b389a11559396fc039511c0dc567d9ade469 from stable/5.2.x.
2025-03-25Fixed #36276 -- Omitted size=None from ArrayField.deconstruct().Tim Graham
2025-03-10Fixed #36222 -- Fixed ExclusionConstraint validation crash on excluded ↵saJaeHyukc
fields in condition. Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2025-03-03Refs #35444 -- Deprecated contrib.postgres.OrderableAggMixin.Chris Muthig
This commit does not create any functional changes, but marks the existing `OrderableAggMixin` class as deprecated so that developers using it directly can be made aware of its future removal.
2025-03-03Fixed #35444 -- Added generic support for Aggregate.order_by.Chris Muthig
This moves the behaviors of `order_by` used in Postgres aggregates into the `Aggregate` class. This allows for creating aggregate functions that support this behavior across all database engines. This is shown by moving the `StringAgg` class into the shared `aggregates` module and adding support for all databases. The Postgres `StringAgg` class is now a thin wrapper on the new shared `StringAgg` class. Thank you Simon Charette for the review.
2025-02-19Fixed #35358, Refs #35234 -- Renamed _check() methods to check() for ↵Mariusz Felisiak
constraints.
2025-01-06Refs #35444 -- Deprecated contrib.postgres aggregates ordering for order_by.Chris Muthig
Aligns the argument with SQL standards already used in Window.order_by and sets up for adding support to Aggregate.
2025-01-03Removed stray comment in ArrayField.check().Tim Graham
2024-12-05Fixed #35944 -- Handled serialization of Unicode values in ArrayField and ↵Oleg Sverdlov
HStoreField.
2024-10-10Fixed #35717 -- Reduced Create/RemoveCollation operations when optimizing ↵Adam Johnson
migrations.
2024-10-07Updated translations from Transifex.nessita
Forwardport of e245f62d0052d7b15fa2a60926d59eeeefee9be1 from stable/5.1.x.
2024-10-07Fixed #35449 -- Fixed validation of array items in SplitArrayField when ↵GappleBee
remove_trailing_nulls=True.
2024-09-09Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK ↵Csirmaz Bendegúz
is set.
2024-08-12Fixed #35575 -- Added support for constraint validation on GeneratedFields.Mark Gensler
2024-08-07Updated translations from Transifex.Natalia
Forwardport of 380c6e6ddd7890fbe65826873579ef6e3af0c07d from stable/5.1.x.
2024-08-05Refs #35638 -- Avoided wrapping expressions with Value in ↵David Sanders
_get_field_value_map() and renamed to _get_field_expression_map().
2024-05-27Fixed #35479 -- Dropped support for PostgreSQL 13 and PostGIS 3.0.Mariusz Felisiak
2024-05-14Fixed #35275 -- Fixed Meta.constraints validation crash on UniqueConstraint ↵Mariusz Felisiak
with OpClass(). This also introduces Expression.constraint_validation_compatible that allows specifying that expression should be ignored during a constraint validation.
2024-05-10Fixed #35436 -- Fixed displaying Unicode chars in forms.HStoreField.SaJH
2024-04-25Fixed #35339 -- Fixed PostgreSQL aggregate's filter and order_by params order.Chris Muthig
Updated OrderableAggMixin.as_sql() to separate the order_by parameters from the filter parameters. Previously, the parameters and SQL were calculated by the Aggregate parent class, resulting in a mixture of order_by and filter parameters. Thanks Simon Charette for the review.
2024-04-25Refs #35339 -- Updated Aggregate class to return consistent source expressions.Chris Muthig
Refactored the filter and order_by expressions in the Aggregate class to return a list of Expression (or None) values, ensuring that the list item is always available and represents the filter expression. For the PostgreSQL OrderableAggMixin, the returned list will always include the filter and the order_by value as the last two elements. Lastly, emtpy Q objects passed directly into aggregate objects using Aggregate.filter in admin facets are filtered out when resolving the expression to avoid errors in get_refs(). Thanks Simon Charette for the review.
2024-02-29Fixed #35234 -- Added system checks for invalid model field names in ↵Simon Charette
ExclusionConstraint.expressions.
2024-01-29Updated translations from Transifex.Claude Paroz
Forwardport of 3cc35aafabb1523c39332ee83e769b085ed3d923 from stable/5.0.x.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-17Fixed #31700 -- Made makemigrations command display meaningful symbols for ↵Amir Karimi
each operation.
2024-01-02Fixed #35075 -- Added deduplicate_items parameter to BTreeIndex.Nick Pope
2023-12-30Fixed #29049 -- Added slicing notation to F expressions.Nick Pope
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com> Co-authored-by: Niclas Olofsson <n@niclasolofsson.se> Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
2023-12-29Refs #35064 -- Made OrderableAggMixin avoid creating empty OrderByList.Simon Charette
This paves the way for making OrderByList a simple shim over ExpressionList which requires at least a single item to be provided.
2023-12-04Updated translations from Transifex.Natalia
Forwardport of 8e1b820fa10d16664beb5d1ca2f5671891da1704 from stable/5.0.x.
2023-09-18Refs #33308 -- Removed support for passing encoded JSON string literals to ↵Mariusz Felisiak
JSONField & co. Per deprecation timeline.