0

Help! I'm a beginner. I am trying to learn PostgreSQL and I am having a lot of trouble trying to get a sample database into my PostgreSQL server. I got the sample database from here at PgFoundry.org and another called booktown. I chose the dellstore2 db. I really can't find a single tutorial out there taking you through the steps to make this happen.

I keep running into the restore command. In pgAdmin3 I keep trying different ways to use restore on a database that I named the same as the sample db but to no avail? All my research lead to this but it just will not work! Can someone please explain this?

The dellstore2 is in tar gz format and the booktown is an sql file.

mr haven
  • 1,494
  • 1
  • 17
  • 28

2 Answers2

3

A SQL script is run using the commandline utility psql:

psql -f booktown.sql your_db your_pg_user

A tar gz needs to be unpacked before you can proceed. I assume it then contains a SQL script as well, that you run the same way.

Chad
  • 2,938
  • 3
  • 27
  • 38
  • that does not do anything for me? Is there a specific place I should put the booktown.sql, like in the data folder for postgres? When you say your_db I made an empty db called booktown for that, is that right? and for your_pg_user is that your role? I have not set one up yet, I have just been using the default one called postgres. Here is what I typed in. 'psql booktown postgres -f booktown.sql' – mr haven Dec 03 '12 at 00:46
0

Postgresql have different way to restore data

1)

psql -f backup.sql dbname

2)

$ pg_restore -d dbname db.tar

3) or use pgadmin

If you want special data restore,(exm GIS data) you have to choose this template in database creator

N B
  • 391
  • 3
  • 12