Failed to restore pg_dump backup

I am trying to restore a backup from Postgres 9.1.1 that was created:

pg_dump mydb > backup.sql 

restore Postgres 9.1.9

 psql -d mydb -f backup.sql 

I get this error:

 psql:datasets.sql:278537: invalid command \. psql:datasets.sql:278544: ERROR: syntax error at or near "1" LINE 1: 1 4446 49 253.412262 239.618317 0 211.54303 100.482948 197.1... 

\. is part of the COPY team, I assume it should be compatible between versions of Postgres 9 or not?

 COPY data_136 (id, in_1, in_2, in_3, in_4, out_1) FROM stdin; 1 5.0999999 3.5 1.39999998 0.200000003 Iris-setosa 2 4.9000001 3 1.39999998 0.200000003 Iris-setosa --- few more line cutted 150 5.9000001 3 5.0999999 1.79999995 Iris-virginica \. 
+4
source share
2 answers

The problem was caused by an earlier error:

 ERROR: permission denied for schema pg_catalog 

I imported a subuser that has all privileges for the databases, since the user solved the problem when importing to postgres .

+1
source

This error occurred to me for the same reason: I was registered as a user with insufficient permissions.

Just for completeness, I’ll tell you how you can do a recovery by specifying the user performing the action:

psql -U postgres -d mydb -f backup.sql

0
source

Source: https://habr.com/ru/post/1479733/


All Articles