Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to restore an sql file which contains the dumpf a table (with COPY commands) into a table into the database, it would be great if someone could share an example, as the pg_restore doesn't help much in this regard. A link would do as well.

Further information: Through the psql command line client I tried to first access the database and then execute the method presented by @a_horse _with_no_name; but nothing seemed to happen, it just went on to show the next prompt; but there was no change in the backend(data was not inserted into the database). I may be doing something grossly wrong here, just got started with PostgreSQL. :)

share|improve this question

migrated from Feb 1 '12 at 14:08

This question came from our site for professional and enthusiast programmers.

What kind of *dumpf" ? is it readable? – wildplasser Feb 1 '12 at 12:01
@a_horse_with_no_name- A step by step of what I did. 1.Windows command line prompt 2. Changed to the bin folder of Postgresql. 3. placed the dump (sql file) in the bin folder. 4.Executed psql dbname<dumpfile.sql. Would be great if you could tell me what Im doing wrong, Thanks! – KodeSeeker Feb 3 '12 at 4:13

If your dump file contains COPY statements, then it's a SQL dump which is restored using psql as explained in the manual.

psql dbname < your_dump_file.sql

More examples are in the manual.

share|improve this answer
tried that!(Nothing happened) In this case my dump file just contains one table, so should a new table be created then? – KodeSeeker Feb 1 '12 at 12:13
You should have included that information (that you already tried psql) into your original question. I don't believe that "nothing happened" - please edit your question to include the exact statements you used (e.g. copy & paste the text from the console) – a_horse_with_no_name Feb 1 '12 at 12:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.