summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/introspection.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2018-09-12 01:36:15 +0100
committerTim Graham <timograham@gmail.com>2018-10-02 14:01:24 -0400
commit45ef3df7d07489ee0b76479cc799faa92e443a69 (patch)
tree1b91f9ef203a2175ae644c6c7c319b3d4f866291 /django/db/backends/postgresql/introspection.py
parent31edb106b5ce3aa125121b748782743f19338307 (diff)
downloaddjango-45ef3df7d07489ee0b76479cc799faa92e443a69.tar.gz
Fixed #29719 -- Added introspection of foreign tables for PostgreSQL.
Thanks infinite-l00p for the initial patch.
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 afd035df77..c20d7b659e 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -44,11 +44,11 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
SELECT c.relname, c.relkind
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
- WHERE c.relkind IN ('r', 'v')
+ WHERE c.relkind IN ('f', 'r', 'v')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid)
""")
- mapping = {'r': 't', 'v': 'v'}
+ mapping = {'f': 't', 'r': 't', 'v': 'v'}
return [
TableInfo(row[0], mapping[row[1]])
for row in cursor.fetchall() if row[0] not in self.ignored_tables