Celestial Bodies DB: Import from Local

Hi all,

I recently started the Celestial Bodies Database challenge, and in order to avoid any potential problems with my browser or CodeRoad, I decided to build the database using a local install of PostgreSQL, then dumping the data, uploading the file to CodeRoad, and rebuilding the database there. I was able to do everything upto the rebuild, but when I went to use \i in PSQL to import my data, I was unable to do so as I didn’t have the role “postgres.” Is there any way to do what I’m looking to do? And if so, would anyone be willing to assist? Thanks.

use this command to create the sql dump first:
pg_dump -cC --inserts -U freecodecamp universe > universe.sql

Then in fcc’s course site, go to a terminal prompt and type
psql -U postgres < universe.sql

Assuming the first command works on your local setup, then the second command should be enough to get your sql setup on the remote VM.

Thanks! I’ll try this when I get back to the course toward the beginning of next week and report back if I have any issues.

1 Like

Thanks again! Just to get back, that did work.

1 Like