分开的pgAdmin和cmd psql数据库 [英] Separated pgAdmin and cmd psql databases

查看:188
本文介绍了分开的pgAdmin和cmd psql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使cmd psql和pgAdmin 4数据库同步?因为他们不同步。 cmd psql将PostgreSQL,模板01和02模板输出为db,而我的pgAdmin4则将postgres和SampleDB作为数据库输出。



psql输出:





pgAdmin显示:





pgAdmin inet:





cmd inet


  1. 从psql命令执行,所有者名称为Warehoused1



正如您在图2中看到的,结果也显示了数据库


  1. 通过psql命令,只需创建没有所有者(默认)名称为Warehouse2的数据库即可。



看到结果了吗?没问题。现在在PgAdmin4中看到





它也在PgAdmin4中显示。我无法提供解决方案,因为我不知道您面临的问题。



编辑:之所以在您的psql和pgAdmin中产生不同的结果,是因为您的系统中有2个postgresql,并且您的路径指向其他postgresql,这意味着您的psql连接到不同的服务器。


How can I make cmd psql and pgAdmin 4 database sync? because they don't sync. cmd psql outputs postgres, template 01, and template 02 as db, while my pgAdmin4 outputs postgres and SampleDB as my databases.

psql output:

pgAdmin display:

pgAdmin inet:

cmd inet cmd inet

解决方案

I don't know the issue you are facing and what are you trying to achieve. do you want to do psql command and not in the gui PgAdmin4 where you can do more easily?

Here i am make new 3 database from pgAdmin4 and psql command

  1. From PgAdmin4 gui and the database name warehouses

  1. From psql command doing with owner name warehoused1

And as you can see in pic 2 the result it show the database too

  1. From psql command just create database without owner (default) name warehoused2

And see the result? no problem at all. Now see in PgAdmin4

It shows too in PgAdmin4. I can't give the solution because i don't know the issue you are facing.

Edit : The reason you have different result in your psql and pgAdmin because you have 2 postgresql in your system and your path lead to other postgresql it means your psql connect to different server.

这篇关于分开的pgAdmin和cmd psql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆