收集python中的所有postgresql模式

收集python中的所有postgresql模式,python,postgresql,Python,Postgresql,我试图以以下格式动态显示postgresql数据库中的所有架构: dbschema = 't1,t2,t3,t4,public' 我的代码如下所示: dbschema = 't1,t2,t3,t4,public' engine = create_engine('postgresql://user:password@127.0.0.1:5432/dbexostock9', connect_args={'options': '-csea

我试图以以下格式动态显示postgresql数据库中的所有架构:

dbschema = 't1,t2,t3,t4,public'
我的代码如下所示:

dbschema = 't1,t2,t3,t4,public'
engine = create_engine('postgresql://user:password@127.0.0.1:5432/dbexostock9',
                               connect_args={'options': '-csearch_path={}'.format(dbschema)})


DB = value_classification.to_sql('dashboard_classification', engine, if_exists='replace')
我正在使用SQLalchemy在数据库中编写代码。正如您所看到的,让dbschema中的内容动态更新但保持这种格式会更方便

我找不到实现这一目标的方法。有人知道怎么做吗