From 40d87681580ee4f223bcd5ba227ef6ab324a6909 Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Sat, 26 May 2018 16:29:02 +0200 Subject: [PATCH] [2.1.x] Refs #27098 -- Removed unused introspection queries. Unused since 578711c31052625cc87319cf1c46662c14d75ce9. Thanks Ian Foote for finding this. Backport of e01fa015c0fca32bb740b575c8fbfd388d8f4957 from master --- .../gis/db/backends/postgis/introspection.py | 20 ------------------- .../db/backends/postgresql/introspection.py | 10 ---------- 2 files changed, 30 deletions(-) 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: