code: def get_table_names(cls, inspector, schema):
          
          tables = inspector.get_table_names(schema)
          tables.extend(inspector.get_foreign_table_names(schema))
          return sorted(tables)
docs: Need to consider foreign tables for PostgreSQL