PostgreSQL:无法查看架构

PostgreSQL:无法查看架构,postgresql,Postgresql,所以我使用的是PostgreSQL 12和pgAdmin4。我在数据库testingDB中从pgAdmin4创建了两个新模式,ml和web。但当我从终端访问它们时,我只能看到publicschema。如何查看其他模式 $ psql -U awspostgres -h address -p 5432 -d testingDB Postgres可以在一个DBMS实例下拥有多个数据库。通过将带有-d标志的名称指定为psql,确保连接到数据库: $ psql -U awspostgres -h ad

所以我使用的是PostgreSQL 12和pgAdmin4。我在数据库
testingDB
中从pgAdmin4创建了两个新模式,
ml
web
。但当我从终端访问它们时,我只能看到
public
schema。如何查看其他模式

$ psql -U awspostgres -h address -p 5432 -d testingDB


Postgres可以在一个DBMS实例下拥有多个数据库。通过将带有
-d
标志的名称指定为
psql
,确保连接到数据库:

$ psql -U awspostgres -h address -p 5432 -d <db name> testingDB
$psql-U awspostgres-h地址-p 5432-d测试数据库

连接到postgres后(即使在启动
psql
时没有提供数据库名称),也可以使用
\l
显示数据库,并使用
\c

连接到数据库,如果希望模式中的表在
\dt
中可见,则可以显式:

\dt ml.*
或者将架构添加到您的
搜索路径中

SET search_path = ml, web, public;
如果希望后一个更改对数据库的所有连接保持不变

ALTER DATABASE "testingDB" SET search_path = ml, web, public;

用户可能没有新方案的权限对如何更改权限有任何建议?我正在使用aws rds for PostgreSql无法解释您的评论。尝试使用创建架构的同一用户,看看这是否是权限问题。是的,我这样做了,但它显示了相同的结果。。。我创建了随机模式->创建模式测试;但是当我键入\dt时,我只能看到公共架构。。。但是当我从中访问它们时,我可以看到模式pgAdmin@Peter如果您从information\u schema.schemata
中选择catalog\u name、schema\u name、schema\u owner,会发生什么情况?另外
从pg_数据库中选择datname、datdba、datistemplate、DATLLOWCONN、datconnlimit、DATCT
?有架构和所有表的列表。在第二行中,我收到了datname=testingDB、datdba=16398、datistemplate=f、datallowconn=t、datconnlimit=-1。用下面的答案解决了我的问题。你刚刚救了我的理智!