summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/introspection.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-19 12:25:20 +0100
committerGitHub <noreply@github.com>2021-01-19 12:25:20 +0100
commit5371342ed66f5ff9feae9dc4586ec43830bbeca6 (patch)
treeb5c5a6f3b264770af4c34411f72c43c5b79a82ce /django/db/backends/postgresql/introspection.py
parent10d126198434810529e0220b0c6896ed64ca0e88 (diff)
downloaddjango-5371342ed66f5ff9feae9dc4586ec43830bbeca6.tar.gz
Fixed #32357 -- Dropped support for PostgreSQL 9.6 and PostGIS 2.3.
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r--django/db/backends/postgresql/introspection.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index a0e49c8da7..4e35cb9e97 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -48,13 +48,13 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
"""Return a list of table and view names in the current database."""
cursor.execute("""
SELECT c.relname,
- CASE WHEN {} THEN 'p' WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
+ CASE WHEN c.relispartition THEN 'p' WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid)
- """.format('c.relispartition' if self.connection.features.supports_table_partitions else 'FALSE'))
+ """)
return [TableInfo(*row) for row in cursor.fetchall() if row[0] not in self.ignored_tables]
def get_table_description(self, cursor, table_name):