T
T
TempForWork2014-11-28 11:24:57
PostgreSQL
TempForWork, 2014-11-28 11:24:57

Server doesn't listen [PostgreSQL] ?

OS: Windows 7 64-bit
PostgreSQL had to be reinstalled on the working computer.
After reinstallation, when trying to connect to a PostgreSQL 9.3 server (localhost: 5432) and creating a new server localhost (localhost: 5432) - an error window appears:
" Server doesn't listen
The server doesn't accept connections: the connection library reports
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? server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
If you encounter this message, please check if the server you're trying to contact is actually running PostgreSQL on the given port. Test if you have network connectivity from your client to the server host using ping or equivalent tools. Is your network / VPN / SSH tunnel / firewall configured correctly?
For security reasons, PostgreSQL does not listen on all available IP addresses on the server machine initially. In order to access the server over the network, you need to enable listening on the address first.
For PostgreSQL servers starting with version 8.0, this is controlled using the "listen_addresses" parameter in the postgresql.conf file. Here, you can enter a list of IP addresses the server should listen on, or simply use '*' to listen on all available IP addresses. For earlier servers (Version 7.3 or 7.4), you'll need to set the "tcpip_socket" parameter to 'true'.
You can use the postgresql.conf editor that is built into pgAdmin III to edit the postgresql.conf configuration file. After changing this file, you need to restart the server process to make the setting effective.
If you double-checked your configuration but still get this error message, it's still unlikely that you encounter a fatal PostgreSQL misbehaviour. You probably have some low level network connectivity problems (eg firewall configuration). Please check this thoroughly before reporting a bug to the PostgreSQL community. "
On the Internet, it is most often advised to check the correctness of pg_hba.conf.
I compared my file with a colleague's file with a running PostgreSQL - the files are identical.
Please tell me how to solve the problem or in which direction to look for a solution?
UPD:
In services, when you try to start the postgresql service, it appears text box:
"The service 'postgresql-x64-9.3' on 'Local Computer' was started and then stopped. Some services stop automatically if they are not in use by other services or programs."

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Demenev, 2015-12-15
@fox354

Greetings!
There was a similar problem. During debriefing, it turned out that pg_hba.conf was saved with "BOM" during editing.
1. How to check?
Open pg_hba.conf in any hex editor. If at the beginning of the document there is "p" ї, then you have a config file saved with "BOM".
There is also a link to this in the launch logs.
2. How to fix?
Open pg_hba.conf in notepad++. In the top menu, select "Encoding", and the drop-down list "Convert to UTF-8 without BOM".
Then save the changes.

S
Swartalf, 2014-11-28
@Swartalf

Check to what address you have postregs bound and what permissions go in pg_hba.conf, and what address you are addressing.
the error says where to look: (localhost:5432) is (::1 : 5432) or (127.0.0.1 : 5432).
Well, it would be nice if you showed the configs, and not:
"Compared my file with a colleague's file with running PostgreSQL - the files are identical."
Oracle is on vacation, colleague's config cannot be read via astral

Z
Zahiriddin Ubaydullaev, 2021-02-15
@Aerozed

So the solution to the problem was as follows, for those who encounter:
Go to Users / your user / appdata / roaming / pgadmin, open the pgadmin4.txt log file, look at the error
I had 10013
The reason for the error is either a lack of rights or the port is busy with other processes
Cleaned and turned off antiviruses, it didn’t help
. Using the netstat -ano command, I found out the process id on port 5432 (postgresql port), found out its id (PID column)
Next, ctrl + shift + esc open the task manager, the details tab and look at which process the port with the desired id is occupied (my id was 2800), click on the process and click on cancel the task
Restart pgadmin4, everything worked for me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question