0

i ran some error today with my postgresql maybe someone can help. I install Postgresql in windows server. I connect using PgAdmin. Usually i just enter my master password, then the next step i enter password for user 'postgres' to connect the my existing server. But today, after i enter password for user 'postgres', it said error FATAL : database "postgres"does not exist. I'll attach the error.

enter image description here

Yesterday is fine. But today got this error. I didn't do anything yesterday to the server. How to solved it ? Need Help. Thank you.

2
  • Hi, and welcome to dba.se! Try using the psql tool and provide an explicit database name! Also, it's best practice to not use the postgres db for ordinary work!
    – Vérace
    Commented Sep 5 at 4:08
  • hi, thank you for you input. But i need to login because i must access my production db. Is there any ways to login ? can i recreate postgres database ? Commented Sep 5 at 4:20

1 Answer 1

0

If the database postgres suddenly doesn't exist, someone must have dropped it. If there is anybody with access to your system who is clueless or malicious enough to do such things, you are in trouble. Who knows what other harm these people did?

You can connect to the template1 database instead. With pgAdmin, you'd have to edit the connection properties and change the "maintenance database" accordingly. When you are connected, create a postgres database again and change the connection settings back.

3
  • i tried connect to template1, but password authentication is failed. I thought the password for template1 should be same with user postgres. Commented Sep 5 at 6:21
  • Right, the password of the user is independent of the database. Use the correct password. Perhaps whoever dropped the database also changed the password? It may be the best thing to wipe out the database (and perhaps the whole machine) and restore a good backup on a safer system. Commented Sep 5 at 6:28
  • oke Thank You for your advise. Commented Sep 5 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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