postgresql:对于给定的表名,什么是模式名?

Joh*_*ohn 2 sql postgresql select data-dictionary

我有一个表名 student 并且我的数据库中有 35 个模式。我怎样才能得到表学生存在的模式?(在不同的模式中可能有多个)。

我已经尝试过了,pg_class但我不知道如何从那里获取架构名称。

Mur*_*nik 6

您可以从information_schema.tables以下位置查询:

SELECT table_catalog, table_schema 
FROM   information_schema.tables 
WHERE  table_name = 'student'
Run Code Online (Sandbox Code Playgroud)