1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

Reformatted PostgreSQL query for better readability

This commit is contained in:
Claude Paroz 2016-08-31 19:45:06 +02:00
parent d389125606
commit 0c6fbea59b

View File

@ -210,13 +210,12 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
SELECT SELECT
*, unnest(i.indkey) as key, unnest(i.indoption) as option *, unnest(i.indkey) as key, unnest(i.indoption) as option
FROM pg_index i FROM pg_index i
) idx, pg_class c, pg_class c2, pg_am am, pg_attribute attr ) idx
WHERE c.oid=idx.indrelid LEFT JOIN pg_class c ON idx.indrelid = c.oid
AND idx.indexrelid=c2.oid LEFT JOIN pg_class c2 ON idx.indexrelid = c2.oid
AND attr.attrelid=c.oid LEFT JOIN pg_am am ON c2.relam = am.oid
AND attr.attnum=idx.key LEFT JOIN pg_attribute attr ON attr.attrelid = c.oid AND attr.attnum = idx.key
AND c2.relam=am.oid WHERE c.relname = %s
AND c.relname = %s
) s2 ) s2
GROUP BY indexname, indisunique, indisprimary, amname; GROUP BY indexname, indisunique, indisprimary, amname;
""", [table_name]) """, [table_name])