[英]Why doesn't psql show my data even though pgadmin has it
I have a database called demo
which has 4 tables.我有一个名为
demo
的数据库,它有 4 个表。
I run psql -U user1 demo
and am able to login, but I cannot see any of the tables.我运行
psql -U user1 demo
并且能够登录,但我看不到任何表。
One of the table is student
.其中一张是
student
。 I can surely just reimport the data all again, but why wouldn't it show here?我当然可以再次重新导入数据,但为什么不在这里显示呢?
My user1
is full admin and has access to everything, so I don't think it's a user related issue.我的
user1
是完全管理员并且可以访问所有内容,所以我认为这不是与用户相关的问题。
All my tables are also owned by user1
, if this makes any difference.我所有的表也归
user1
所有,如果这有什么不同的话。
I am not using a VM, everything is on my local machine.我没有使用虚拟机,一切都在我的本地机器上。
You need to add university
schema to your search_path
.您需要将
university
模式添加到您的search_path
。 Either you can SET search_path TO...
or add it to search_path
in postgresql.conf
.您可以
SET search_path TO...
或将其添加到postgresql.conf
中的search_path
中。 Otherwise, you could perform your SELECT
with fully-qualified table name:否则,您可以使用完全限定的表名执行
SELECT
:
SELECT * FROM university.student;
Disclosure: I work for EnterpriseDB (EDB)披露:我为EnterpriseDB (EDB)工作
Your tables are located in the schema university
you need to use:您的表位于您需要使用的架构
university
中:
select *
from university.student;
To list the tables in that schema, use: \d university.*
要列出该架构中的表,请使用:
\d university.*
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.