Restore a PostGis dump 2

0

I'm trying to restore a dump from a postgresql database with postgis template.

When I try to restore the dump by terminal, I have a series of errors.

Terminal used command:

  

psql archeology -U cc1295225 -h 127.0.0.1 -p 45432 < exits_owner.sql > error.log 2 > & 1

Errors can be seen from the following file error.log

And when I try to restore using pgadmin in Create script I get the following error message:

COPY estado (gid, id, cd_geocodu, nm_estado, nm_regiao, the_geom) FROM stdin;
ERROR:  syntax error at or near "1"
LINE 13926: 1 6 35 SÃO PAULO SUDESTE 0106000060421200003B000000010300004...
            ^
********** Error **********

ERROR: syntax error at or near "1"
SQL state: 42601
Character: 424037

Doubt

So how should I proceed to be able to restore the database with postgis template? Or fix this dump error problem.

    
asked by anonymous 11.02.2014 / 21:14

1 answer

0

I got the help of a friend to figure out a solution. PostgreSQL does not understand the postgis tables, to solve the problem it is necessary to transform the tables into shapes and return the sql again one by one. We have not yet found a solution that postgreSQL accepts all at once, but this conversion solution already solves some of the problems.

Then to solve the problem we use:

pgsql2shp

For conversion to shapes, we use:

shp2pgsql

To convert back to the postgreSQL sql.

Thanks for trying to help!

    
13.02.2014 / 17:58