Create new local server in pgadmin?

Theo F picture Theo F · Nov 12, 2018 · Viewed 40k times · Source

I have PostgreSQL 11 and PGadmin 4 installed on windows. Currently I'm connected to a AWS server which hosts all of my data.

I want to create a local server (localhost) as a testing environment where I can experiment. I can't seem to do it though, and the other similar questions on stack don't help. Here's what my process is:

  1. in pgAdmin, right click 'Servers' and go Create>Server

  2. On the 'Create - Server' pop up box, i type in Name: Localserver. For 'connection' I type localhost. Port I leave as default '5432', db: postgres, username: postgres password: empty

  3. click save.

however, I get an error:

Unable to connect to server:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

screenshot of error message

What should I do? I am the admin if that makes a difference.

Answer

Chris Curvey picture Chris Curvey · Nov 12, 2018

This is probably one of two things.

  1. You have set up a Postgres server, but have not adjusted listen_addresses in your postgresql.conf file, or

  2. You have not set up a Postgres server on your local machine. ("Create Server" is a bit misleading, it should probably be "Create Server Connection".)