1

i am totally new to postgresql and i have database as dump file on postgresql which i need to restore/upload it back.. i didnt dumped the file its already available online. I read the documentation of restore command on postgresql but it didnt work w me and i am not sure from the steps that I should follow to successfully upload it!! Please if anyone has an idea or could at least refer me to a really good resources for how to do it I will really appreciate it

1 Answer 1

1

Usually its as simple as:

psql dbname < infile

or if it's a custom-format dump:

pg_restore --dbname mydb infile
Sign up to request clarification or add additional context in comments.

11 Comments

So I dont have to creat a new DB cuz that what I did first and then I typed that command but nothing happened!!
Well, help me help you. What do you mean by "nothing happened"? Did you get an error of some type? Did you see any text scroll by? Anything? What operating system are you using?
thanks for helping me... I am using mac, so what I did is the following: 1. create a new database called ex new 2. run SQL shell (psql) 3. type psql new < file.dump and there is no error, and when I checked back the new db there was no tables!! I am not sure what I did is right?
No no... Don't do step number 2. Just run step 3 from the command prompt.
oh I see so now I get an error "syntax error at or near "psql""; I tried to use psql --set ON_ERROR_STOP=on dbname < infile but still getting the same error
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.