Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. 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

My backup file containing about 50-60 tables , but I am able to just load only 6 tables for a new db and 31 tables for postgis dbase . And this was the error when I restore a backup file.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1393; 0 0 SHELL TYPE box2d postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  type "box2d" already exists
    Command was: CREATE TYPE box2d;

I should I resolve this problem. I am using PostgreSQL 9.1 and please help me how can I load all tables without any backup file contains 90 MB.

share|improve this question
can you show us how you made the backup and how you are trying to restore it. – iant May 23 '13 at 7:44
I think this question is a better fit for – Devdatta Tengshe May 23 '13 at 8:02
I think this question is OK here as the error relates specifically to using PostGIS as opposed to the generalities of using Postgresql. – MappaGnosis May 23 '13 at 8:27
selecting the database and Tools-->Restore and neither of the properties are changed like only data, only schema etc. – SriRamaChandra.G May 23 '13 at 8:33
Like @altefren said, it should be working but if you don't want errors doing a find and replace to change "CREATE X" to "CREATE OR REPLACE X" should get rid of them. – Jakub Kania May 23 '13 at 18:07
up vote 6 down vote accepted

I guess you are a victim of the fact that spatially enabling a PostgreSQL db with PostGIS creates a bunch of functions in the "public" namespace. If you backup the public namespace and then restore it to a PostGIS db these functions will already exist, causing errors. As Paul Ramsey wrote (in a blog post explaining the issue in detail and giving advice):

you can ensure the greatest ease in doing dump and restore of PostGIS data if you ensure that you store no data in the "public" schema.

share|improve this answer
thanks a lot it helped me – SriRamaChandra.G May 24 '13 at 5:24

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.