Q
Q
Quiab2020-06-13 19:55:51
PostgreSQL
Quiab, 2020-06-13 19:55:51

How to raise a Postgres database in the background?

Hello, the question is as follows:
There is a PostgreSQL DBMS on a virtual machine
There is an application on the host that connects to this database

I spent n hours trying to connect to this database, but in the end it worked out. To celebrate, I started testing. Turned off the virtual machine, closing the connection beforehand Turned on the virtual machine
again and tried to open the connection from the host, to which I received an error: Is the server running ...", the server type was not running. I
went into the virtual machine, switched to the POSTGRES user, opened PSQL, switched ( \c) to the database, after that I tried to raise the connection again and everything worked! ( PS When I close the console with \q, I can still connect to the database, checked )
The question is how to avoid the constant repetition of the actions of raising the database? I want the database to be immediately available to the host when launching the virtual machine. And why does this problem appear? PostgreSQL is still spinning in the background without starting
Thanks in advance for the answers!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2020-06-13
@Quiab

If the server was forcibly shut down, it needs some time after the restart to re-roll the WAL.
So it was just necessary to wait this time, well, and not turn off the DBMS server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question