Restore a Postgis dump 2

Asked

Viewed 109 times

0

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

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

Command used terminal:

psql archeology -U cc1295225 -h 127.0.0.1 -p 45432 < saidas_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 do I proceed to be able to perform the database Restore with postgis template? Or fix this dump error problem.

  • Already tried as a superuser?

1 answer

0


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

So to solve the problem we use:

pgsql2shp

For conversion into shapes, and we use:

shp2pgsql

To convert again to postgresql sql.

Thank you for trying to help!.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.