Skip to content

Commit 5bd7757

Browse files
felixxmjacobtylerwalls
authored andcommitted
Fixed #36623 -- Dropped support for PostgreSQL 14 and PostGIS 3.1.
1 parent 2514857 commit 5bd7757

13 files changed

Lines changed: 31 additions & 30 deletions

File tree

.github/workflows/schedule_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
name: Selenium tests, PostgreSQL
105105
services:
106106
postgres:
107-
image: postgres:14-alpine
107+
image: postgres:15-alpine
108108
env:
109109
POSTGRES_DB: django
110110
POSTGRES_USER: user

.github/workflows/selenium.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: PostgreSQL
4444
services:
4545
postgres:
46-
image: postgres:14-alpine
46+
image: postgres:15-alpine
4747
env:
4848
POSTGRES_DB: django
4949
POSTGRES_USER: user

django/contrib/gis/db/backends/postgis/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def spatial_version(self):
204204
raise ImproperlyConfigured(
205205
'Cannot determine PostGIS version for database "%s" '
206206
'using command "SELECT postgis_lib_version()". '
207-
"GeoDjango requires at least PostGIS version 3.1. "
207+
"GeoDjango requires at least PostGIS version 3.2. "
208208
"Was the database created from a spatial database "
209209
"template?" % self.connection.settings_dict["NAME"]
210210
)

django/db/backends/postgresql/features.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class DatabaseFeatures(BaseDatabaseFeatures):
10-
minimum_database_version = (14,)
10+
minimum_database_version = (15,)
1111
allows_group_by_selected_pks = True
1212
can_return_columns_from_insert = True
1313
can_return_rows_from_bulk_insert = True
@@ -67,6 +67,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
6767
supports_update_conflicts_with_target = True
6868
supports_covering_indexes = True
6969
supports_stored_generated_columns = True
70+
supports_nulls_distinct_unique_constraints = True
7071
can_rename_index = True
7172
test_collations = {
7273
"deterministic": "C",
@@ -155,10 +156,6 @@ def introspected_field_types(self):
155156
"PositiveSmallIntegerField": "SmallIntegerField",
156157
}
157158

158-
@cached_property
159-
def is_postgresql_15(self):
160-
return self.connection.pg_version >= 150000
161-
162159
@cached_property
163160
def is_postgresql_16(self):
164161
return self.connection.pg_version >= 160000
@@ -172,10 +169,6 @@ def is_postgresql_18(self):
172169
return self.connection.pg_version >= 180000
173170

174171
supports_unlimited_charfield = True
175-
supports_nulls_distinct_unique_constraints = property(
176-
operator.attrgetter("is_postgresql_15")
177-
)
178-
179172
supports_any_value = property(operator.attrgetter("is_postgresql_16"))
180173
supports_virtual_generated_columns = property(
181174
operator.attrgetter("is_postgresql_18")

docs/ref/contrib/gis/install/geolibs.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Program Description Required
1717
`PROJ`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 9.x, 8.x, 7.x, 6.x
1818
:ref:`GDAL <gdal-overview>` Geospatial Data Abstraction Library Yes 3.11, 3.10, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1
1919
:ref:`GeoIP <geoip2-overview>` IP-based geolocation library No 2
20-
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 3.5, 3.4, 3.3, 3.2, 3.1
20+
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 3.5, 3.4, 3.3, 3.2
2121
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 5.1, 5.0, 4.3
2222
============================== ==================================== ================================ =======================================================
2323

@@ -44,7 +44,6 @@ totally fine with GeoDjango. Your mileage may vary.
4444
GDAL 3.9.0 2024-05-10
4545
GDAL 3.10.0 2024-11-06
4646
GDAL 3.11.0 2025-05-09
47-
PostGIS 3.1.0 2020-12-18
4847
PostGIS 3.2.0 2021-12-18
4948
PostGIS 3.3.0 2022-08-27
5049
PostGIS 3.4.0 2023-08-15

docs/ref/contrib/gis/install/index.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ supported versions, and any notes for each of the supported database backends:
5757
================== ============================== ================== =========================================
5858
Database Library Requirements Supported Versions Notes
5959
================== ============================== ================== =========================================
60-
PostgreSQL GEOS, GDAL, PROJ, PostGIS 14+ Requires PostGIS.
60+
PostgreSQL GEOS, GDAL, PROJ, PostGIS 15+ Requires PostGIS.
6161
MySQL GEOS, GDAL 8.0.11+ :ref:`Limited functionality <mysql-spatial-limitations>`.
6262
Oracle GEOS, GDAL 19+ XE not supported.
6363
SQLite GEOS, GDAL, PROJ, SpatiaLite 3.31.0+ Requires SpatiaLite 4.3+
@@ -305,7 +305,7 @@ Summary:
305305

306306
.. code-block:: shell
307307

308-
$ sudo port install postgresql14-server
308+
$ sudo port install postgresql15-server
309309
$ sudo port install geos
310310
$ sudo port install proj6
311311
$ sudo port install postgis3
@@ -319,14 +319,14 @@ Summary:
319319

320320
.. code-block:: shell
321321

322-
export PATH=/opt/local/bin:/opt/local/lib/postgresql14/bin
322+
export PATH=/opt/local/bin:/opt/local/lib/postgresql15/bin
323323

324324
In addition, add the ``DYLD_FALLBACK_LIBRARY_PATH`` setting so that
325325
the libraries can be found by Python:
326326

327327
.. code-block:: shell
328328

329-
export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:/opt/local/lib/postgresql14
329+
export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:/opt/local/lib/postgresql15
330330

331331
__ https://www.macports.org/
332332

docs/ref/contrib/postgres/aggregates.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ General-purpose aggregation functions
7676
.. class:: BitXor(expression, filter=None, default=None, **extra)
7777

7878
Returns an ``int`` of the bitwise ``XOR`` of all non-null input values, or
79-
``default`` if all values are null. It requires PostgreSQL 14+.
79+
``default`` if all values are null.
8080

8181
``BoolAnd``
8282
-----------

docs/ref/contrib/postgres/constraints.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ used for queries that select only included fields
130130
(:attr:`~ExclusionConstraint.include`) and filter only by indexed fields
131131
(:attr:`~ExclusionConstraint.expressions`).
132132

133-
``include`` is supported for GiST indexes. PostgreSQL 14+ also supports
134-
``include`` for SP-GiST indexes.
133+
``include`` is supported for GiST and SP-GiST indexes.
135134

136135
``violation_error_code``
137136
------------------------

docs/ref/databases.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ below for information on how to set up your database correctly.
119119
PostgreSQL notes
120120
================
121121

122-
Django supports PostgreSQL 14 and higher. `psycopg`_ 3.1.12+ or `psycopg2`_
122+
Django supports PostgreSQL 15 and higher. `psycopg`_ 3.1.12+ or `psycopg2`_
123123
2.9.9+ is required, though the latest `psycopg`_ 3.1.12+ is recommended.
124124

125125
.. note::

docs/ref/models/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ creates a unique constraint that only allows one row to store a ``NULL`` value
273273
in the ``ordering`` column.
274274

275275
Unique constraints with ``nulls_distinct`` are ignored for databases besides
276-
PostgreSQL 15+.
276+
PostgreSQL.
277277

278278
``violation_error_code``
279279
------------------------

0 commit comments

Comments
 (0)