diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index b8a8b2e..f426834 100644
a
|
b
|
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
39 | 39 | |
40 | 40 | def get_table_list(self, cursor): |
41 | 41 | "Returns a list of table names in the current database." |
42 | | cursor.execute("SELECT TABLE_NAME FROM USER_TABLES") |
| 42 | cursor.execute("SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME") |
43 | 43 | return [row[0].lower() for row in cursor.fetchall()] |
44 | 44 | |
45 | 45 | def get_table_description(self, cursor, table_name): |
diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py
index 2fa1248..f02424e 100644
a
|
b
|
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
30 | 30 | LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace |
31 | 31 | WHERE c.relkind IN ('r', 'v', '') |
32 | 32 | AND n.nspname NOT IN ('pg_catalog', 'pg_toast') |
33 | | AND pg_catalog.pg_table_is_visible(c.oid)""") |
| 33 | AND pg_catalog.pg_table_is_visible(c.oid) |
| 34 | ORDER BY c.relname""") |
34 | 35 | return [row[0] for row in cursor.fetchall()] |
35 | 36 | |
36 | 37 | def get_table_description(self, cursor, table_name): |
diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py
index 3bd9d60..b425b64 100644
a
|
b
|
class IntrospectionTests(TestCase):
|
40 | 40 | |
41 | 41 | def test_table_names(self): |
42 | 42 | tl = connection.introspection.table_names() |
| 43 | self.assertEqual(tl, sorted(tl)) |
43 | 44 | self.assertTrue(Reporter._meta.db_table in tl, |
44 | 45 | "'%s' isn't in table_list()." % Reporter._meta.db_table) |
45 | 46 | self.assertTrue(Article._meta.db_table in tl, |