Losing progress on SQL course after closing VS Code and Docker

So I’m trying to do the SQL course by building a student database, and every time I close the docker and VS Code I can’t get back into the DB. I don’t have all the project files in my explorer and I get this error when trying to connect again:

“psql: error: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?”

Is there something I’m doing wrong, and can I fix this or is it just how it is for now?

I am facing this error, too. Have you resolved it? @xRaizel

No I haven’t, and the answers I’ve gotten in another topic didn’t fix it. How about you?

you should create the same files locally,
only for persisting in your steps,
and if it’s SQL DB, you can create a dump file,
as explained at the beginning of the solution page,
so you can retrieve them when restarting docker.


Hey,

Same error for me here. I did save the db as mentioned in the instructions and as you can see on the terminal the DB is saved in the project directory but it still doesn’t open it.
Every time I close VS I basically loose all my progress.

I hope anyone could help,
Thanks !

SOLUTION :
I’ve actually just found a solution - It works for me.
Follow step 1 / 2 of this post PostgreSQL: Why psql can’t connect to server? - Stack Overflow
The steps 1 / 2 involving the pg_lsclusters command (scroll down to second post).
Then connect back to psql then use the psql -U to retrieve your progress.
Don’t forget to dump your progress every time you’re done !

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.