Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 errors.my 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 dba.stackexchange.com –  Devdatta Tengshe May 23 '13 at 8:02
2  
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

1 Answer 1

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

 
discard

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.