Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 19e63f2

Browse files
authoredMar 17, 2025··
Update PostgreSQL backend is_postgresql_* properties for Django 5.1 (#2566)
Various commits upstream removed and added these properties, e.g. django/django@81ccf92. This PR syncs them to match the state of Django 5.1: https://github.com/django/django/blob/8cb8820fbfbf2da4ebcae5f784cea3a0939d5639/django/db/backends/postgresql/features.py#L155-L165
1 parent ffd0b8c commit 19e63f2

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed
 

‎django-stubs/db/backends/postgresql/features.pyi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ class DatabaseFeatures(BaseDatabaseFeatures):
4545
has_json_operators: bool
4646
json_key_contains_list_matching_requires_list: bool
4747
@property
48-
def is_postgresql_10(self) -> bool: ...
48+
def is_postgresql_14(self) -> bool: ...
4949
@property
50-
def is_postgresql_11(self) -> bool: ...
51-
@property
52-
def is_postgresql_12(self) -> bool: ...
50+
def is_postgresql_15(self) -> bool: ...
5351
@cached_property
54-
def is_postgresql_13(self) -> bool: ...
52+
def is_postgresql_16(self) -> bool: ...
5553
has_brin_autosummarize: bool
5654
has_websearch_to_tsquery: bool
5755
supports_table_partitions: bool

‎scripts/stubtest/allowlist.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ django.db.backends.mysql.features.DatabaseFeatures.update_can_self_select
271271
django.db.backends.oracle.features.DatabaseFeatures.supports_boolean_expr_in_select_clause
272272
django.db.backends.oracle.features.DatabaseFeatures.supports_frame_exclusion
273273
django.db.backends.postgresql.base.DatabaseWrapper.pg_version
274-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_13
274+
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_14
275+
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_15
276+
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_16
275277
django.db.migrations.RenameField.new_name_lower
276278
django.db.migrations.RenameField.old_name_lower
277279
django.db.migrations.RenameIndex.new_name_lower

‎scripts/stubtest/allowlist_todo.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,6 @@ django.db.backends.postgresql.base.psycopg_version
530530
django.db.backends.postgresql.features.DatabaseFeatures.django_test_expected_failures
531531
django.db.backends.postgresql.features.DatabaseFeatures.has_bit_xor
532532
django.db.backends.postgresql.features.DatabaseFeatures.introspected_field_types
533-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_10
534-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_11
535-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_12
536-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_14
537533
django.db.backends.postgresql.features.DatabaseFeatures.prohibits_null_characters_in_text_exception
538534
django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_spgist_indexes
539535
django.db.backends.postgresql.features.DatabaseFeatures.uses_server_side_binding

‎scripts/stubtest/allowlist_todo_django51.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ django.db.backends.oracle.features.DatabaseFeatures.supports_comparing_boolean_e
4545
django.db.backends.postgresql.base.DatabaseWrapper.close_pool
4646
django.db.backends.postgresql.base.DatabaseWrapper.pool
4747
django.db.backends.postgresql.features.DatabaseFeatures.django_test_skips
48-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_16
4948
django.db.backends.sqlite3.base.DatabaseWrapper.transaction_modes
5049
django.db.migrations.autodetector.MigrationAutodetector.generate_altered_index_together
5150
django.db.migrations.autodetector.OperationDependency
@@ -78,7 +77,6 @@ django.db.backends.mysql.features.DatabaseFeatures.supports_expression_defaults
7877
django.db.backends.oracle.features.DatabaseFeatures.supports_primitives_in_json_field
7978
django.db.backends.oracle.features.DatabaseFeatures.test_collations
8079
django.db.backends.oracle.oracledb_any
81-
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_15
8280
django.db.backends.postgresql.features.DatabaseFeatures.supports_nulls_distinct_unique_constraints
8381
django.db.backends.postgresql.psycopg_any
8482
django.db.backends.sqlite3.schema.DatabaseSchemaEditor.sql_alter_column_comment

0 commit comments

Comments
 (0)
Please sign in to comment.