diff --git a/django/contrib/gis/db/backends/postgis/introspection.py b/django/contrib/gis/db/backends/postgis/introspection.py index 97fa7480e6..9b4458efea 100644 --- a/django/contrib/gis/db/backends/postgis/introspection.py +++ b/django/contrib/gis/db/backends/postgis/introspection.py @@ -19,26 +19,6 @@ class PostGISIntrospection(DatabaseIntrospection): 'raster_overviews', ] - # Overridden from parent to include raster indices in retrieval. - # Raster indices have pg_index.indkey value 0 because they are an - # expression over the raster column through the ST_ConvexHull function. - # So the default query has to be adapted to include raster indices. - _get_indexes_query = """ - SELECT DISTINCT attr.attname, idx.indkey, idx.indisunique, idx.indisprimary - FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index idx, - pg_catalog.pg_attribute attr, pg_catalog.pg_type t - WHERE - c.oid = idx.indrelid - AND idx.indexrelid = c2.oid - AND attr.attrelid = c.oid - AND t.oid = attr.atttypid - AND ( - attr.attnum = idx.indkey[0] OR - (t.typname LIKE 'raster' AND idx.indkey = '0') - ) - AND attr.attnum > 0 - AND c.relname = %s""" - def get_postgis_types(self): """ Return a dictionary with keys that are the PostgreSQL object diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 859282057a..a24e37b0b8 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -29,16 +29,6 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): ignored_tables = [] - _get_indexes_query = """ - SELECT attr.attname, idx.indkey, idx.indisunique, idx.indisprimary - FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, - pg_catalog.pg_index idx, pg_catalog.pg_attribute attr - WHERE c.oid = idx.indrelid - AND idx.indexrelid = c2.oid - AND attr.attrelid = c.oid - AND attr.attnum = idx.indkey[0] - AND c.relname = %s""" - def get_field_type(self, data_type, description): field_type = super().get_field_type(data_type, description) if description.default and 'nextval' in description.default: