Search code examples
postgresqlpgadmin-4

Separated pgAdmin and cmd psql databases


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:

enter image description here

pgAdmin display:

enter image description here

pgAdmin inet:

enter image description here

cmd inet cmd inet


Solution

  • 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.