为什么PostgreSQL的\dt只显示公共模式表? [英] Why does PostgreSQL's \dt show only public schema tables?
本文介绍了为什么PostgreSQL的\dt只显示公共模式表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用psql在PostgreSQl数据库中创建了一个新模式:
I have created a new schema in my PostgreSQl database with psql:
CREATE SCHEMA my_schema;
但是当我发布 \dt
命令,我只能看到 public
模式中的表。但是,我可以使用 my_schema.table_name
访问 my_schema
中的所有表。
But when I issue the \dt
command, I see only the tables that are in the public
schema. However, I can access all the tables in my_schema
with my_schema.table_name
.
如何在psql中的所有模式中查看所有表?
How can I see all the tables from all the schemas in psql?
推荐答案
对于您的模式(请注意模式名称后的句点):
\dt my_schema.
或:
SET search_path TO my_schema, public;
\dt
对于所有模式:
\dt *.
这篇关于为什么PostgreSQL的\dt只显示公共模式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文