From 86bb9a05020b8fadaab26f4f796c3c4d9adb8c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Mon, 17 Oct 2016 04:16:13 -0700 Subject: [PATCH] Refs #20888 -- Fixed index ordering introspection on PostgreSQL 9.6. --- django/db/backends/postgresql/introspection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 24bd45c1da..99c1fe91ee 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -207,8 +207,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): WHEN idx.indexprs IS NOT NULL THEN pg_get_indexdef(idx.indexrelid) END AS exprdef, - CASE - WHEN am.amcanorder THEN + CASE am.amname + WHEN 'btree' THEN CASE (option & 1) WHEN 1 THEN 'DESC' ELSE 'ASC' END