def get_table_list(cursor):
    cursor.execute("""
        SELECT c.relname
        FROM pg_catalog.pg_class c
        LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
        WHERE c.relkind IN ('r', 'v', '')
            AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
            AND pg_catalog.pg_table_is_visible(c.oid)""")
    return [row[0] for row in cursor.fetchall()]
Returns a list of table names in the current database.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-0.96/django/db/backends/postgresql/introspection.py/get_table_list