问题
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
回答1:
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
- From PgAdmin4 gui and the database name warehouses
- From psql command doing with owner name warehoused1
And as you can see in pic 2 the result it show the database too
- 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.
回答2:
Solved!
Turns out I have 2 postgreSQL installed.
Uninstalled both and install only one and restarted computer. deleted appData/roaming/pgAdmin and postgreSQL folder.
来源:https://stackoverflow.com/questions/52381836/separated-pgadmin-and-cmd-psql-databases