V
V
Vitaly2016-07-19 10:36:01
PostgreSQL
Vitaly, 2016-07-19 10:36:01

How to properly restore a Postgress database dump?

All the best! I'm trying to restore the database from the sql.gz dump with the command gunzip -c sql.gz | psql old
At first it cursed me for the role

ERROR: role "old" does not exist

I created it, but now the following error that can not be defeated :(

ERROR: multiple primary keys for table "actions" are not allowed
ERROR: multiple primary keys for table "users" are not allowed
WARNING: no privileges could be revoked for "public"
REVOKE
WARNING: no privileges could be revoked for "public"

Сильно не ругайте,я новичок в sql

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
serikd, 2016-07-20
@serikd

The problem is rather related to the fact that before restoring the dump, you need to delete all table rows from the database you want to restore.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question