简体   繁体   English

为什么 psql 不显示我的数据,即使 pgadmin 有它

[英]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.

相关问题 psql 中的数据库不显示在 PgAdmin4 中 - Databases in psql Don't Show up in PgAdmin4 \crosstabview 在 PSQL 命令行中有效,但在 PGADMIN 中无效 - \crosstabview works in PSQL commandline but doesn't work in PGADMIN 无法在 pgAdmin 4 上查询数据,但它可以使用 psql 和 Python - Can't query data on pgAdmin 4 but it works using psql and Python 使用psql进行SELECT,即使有数据也不会返回任何行 - SELECT using psql returns no rows even though data is there 为什么我的 SQL 查询不在 PgAdmin 4 中运行,而是在在线 SQL 编辑器中运行 - Why doesn't my SQL query run in PgAdmin 4 but runs in SQL editor online plpgsql - pgAdmin 4不显示RAISE消息(例如,NOTICE) - plpgsql - pgAdmin 4 doesn't show RAISE messages (ex., NOTICE) pgAdmin 不显示来自 Yugabyte DB 的用户表 - pgAdmin doesn't show user's tables from Yugabyte DB 在Datasql会话中不会显示在psql Shell中所做的更改 - Changes doing in psql shell doesn't show up in Datagrip session 为什么这些编码的输出显示在我的psql控制台中? - Why did those encoded output show in my psql console? 我在Mac上设置了psql和pgadmin。 我可以在两者上创建数据库和表,但是它们似乎无法连接 - I setup psql and pgadmin on my mac. I can create database and tables on both but they don't seem to connect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM