无法在通过 Docker 化的 PostgreSQL 创建的表中在 pgAdmin4 中看到表格。

huangapple go评论66阅读模式
英文:

Can't see tables in pgAdmin4 that were created through dockerized PostgreSQL

问题

我通过Docker容器运行PostgreSQL。我进入容器并使用psql连接到postgres。我在test_db中创建了两个数据库,然后创建了一个表。我检查了pgAdmin4,数据库都在那里,但UI中没有显示students表。不确定为什么数据库显示出来而表没有显示?

英文:

I'm running PostgreSQL through a Docker container. I entered the container and used psql to connect to postgres. I created two databases then created a table in test_db. I checked pgAdmin4 and the databases were there but the students table is not showing up in the UI. Not sure why if the databases are showing up?

无法在通过 Docker 化的 PostgreSQL 创建的表中在 pgAdmin4 中看到表格。

答案1

得分: 1

I see you connected to 'test_db' database in pgadmin, but to 'postgres' database in psql. If you want to see 'students' table from 'test_db' database in psql, you need to connect to 'test_db' database firstly instead of 'postgres' database. You can use '\c test_db' command for that in psql, or '-d test_db' command-line parameter when launching psql from the command line.

英文:

I see you connected to 'test_db' database in pgadmin, but to 'postgres' database in psql. If you want to see 'students' table from 'test_db' database in psql, you need connect to 'test_db' database firstly instead of 'postgres' database. You can use '\c test_db' command for that in psql, or '-d test_db' command-line parameter when launching psql from command line.

huangapple
  • 本文由 发表于 2023年2月10日 12:10:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75406865.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定