标签: sql postgresql select data-dictionary
我有一个表名学生,我的数据库中有35个模式。 如何获得表学生所在的模式? (在不同的模式中可能有多个)。
我已经尝试了pg_class,但我不知道如何从那里获取架构名称。
pg_class
答案 0 :(得分:3)
您可以从information_schema.tables查询:
information_schema.tables
SELECT table_catalog, table_schema FROM information_schema.tables WHERE table_name = 'student'