英文:
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?
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论