2

当我使用 in 中的\d命令时psql,我会得到所有用户的表和序列的列表。

是否有一个命令只显示特定用户是所有者的表?

4

1 回答 1

3

不是 psql 命令:

select c.relname, relkind
from
    pg_class c
    inner join
    pg_roles r on r.oid = c.relowner
where
    r.rolname = 'that_owner'
    and
    c.relkind = 'r'
order by c.relname

如果你想要表格和序列:

    and
    c.relkind in ('r', 'S')
于 2013-01-30T12:44:37.297 回答