It's the second time that I install PostgreSQL with the PostGIS extension and it runs as long as I don't restart the PC. After I have restarted the PC QGIS and PgAdmin4 can't connect to the database. How can I fix that?

I have PostgreSQL 9.6.1-1 and PostGIS 2.3.1 and Windows 7.

error message pdAdmin 4

error message QGIS 2.18.1

closed as off-topic by BradHards, user30184, ArMoraer, Hornbydd, mkennedy Dec 25 '16 at 21:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions relating to general IT or with no clear GIS component, are off-topic here but can be researched/asked at Stack Overflow (software development), Super User (computing hardware and software), Database Administrators (relational databases) and other SE sites" – BradHards, user30184, ArMoraer, Hornbydd, mkennedy
If this question can be reworded to fit the rules in the help center, please edit the question.

  • in QGIS, delete the connection to the database that is giving you this problem. and establish a new connection – ziggy Dec 15 '16 at 19:31
  • if you installed it twice, your new install might be running on port 5433 where as your old one was running on port 5432. and if you connected your database through QGIS when your port was 5432 it cannot connect to the new database that is in port 5433 – ziggy Dec 15 '16 at 19:33
  • thats what happened to me – ziggy Dec 15 '16 at 19:33
  • 2
    Is the database actually running? Have you set it up as a service to automatically start on PC reboot? – nmtoken Dec 15 '16 at 19:58
  • 1
    In Windows, click on the Windows icon in the bottom left and search for "Services". Choose the result with the gear-like icon. Scroll down alphabetically and look for postrgesql. You should see status=Started, Startup Type=Automatic and Log On As = Network Service. You can right-click to change properties. – Nate Wanner Dec 17 '16 at 20:20

You either need to enable it as a windows service, or start it manually.

Windows services can be slightly tricky, I would first do the manual step of starting it via the CMD line as documented in this stackoverflow answer https://stackoverflow.com/questions/5881845/how-to-manually-configure-and-start-postgresql-on-windows

Also I believe that to install it as a service might be dependent on the PostgreSQL installer you used. The installer may have created a 'postgresql' user to run the service as.

Not the answer you're looking for? Browse other questions tagged or ask your own question.