Terminal Issues in Relational DB Course

Hello here, I just finished up the Periodic Table Database challenge and downloaded the local files and have uploaded them into an external repo, but I realised I had forgotten to create a dump of my database. I had already closed VSCode. When I reopened VSCode using the terminal in the rbd-alpha folder for my project, I reopened the container using Dev Containers but didn’t rebuild it so all my progress is saved. I then reopened CodeRoad. All my progress is still here, but when I type in the terminal the command to make a dump of my SQL DB

pg_dump -cC --inserts -U freecodecamp periodic_table > periodic_table.sql

, it shows the error message that PostgreSQL refused my connection.

I tried exiting the terminal and reopening it to try again, but it doesn’t work. I can’t press to reset the terminal, and the periodic_table.sql file you see at the side is empty.

Have I just locked myself out of being able to download a local copy of the DB? Is there a way to fix this?

Thanks for any and all help here :slight_smile: .

It is good that you didn’t rebuild the container. This would have destroyed your work for sure.

One thing to try if you haven’t yet is to close the terminal and click Reset.
Then open a new terminal and try the psql command to see if you can connect.

also after you try the above steps, if still unable to connect, can you run this command in the terminal:
systemctl status | grep 'postgres'

and share the output here?

Oh, well I already completed this project and the entire certification at this point, passed all the test cases and uploaded my code, hence I have already closed and deleted the container at this point :grimacing: . I believe I couldn’t press Reset after closing the terminal because the challenge was considered “completed”. You can see in the screenshot that the Reset button is blacked out. Sorry that I can’t try out the command there now. Thanks for your help though.

glad things worked out, but I’m confused what help you were needing when you originally posted (if you’ve already done everything).

Oh sorry, at the start I wasn’t sure whether my submission was going to be accepted because the .sql file was missing in my local copy of the submission, so I just posted jic, but I got my certification in the end so I guess all is good? Thanks for replying though :slightly_smiling_face: