简体   繁体   中英

PostgreSQL pg_restore errors: GRANT, REVOKE

I attempted to restore a PostgreSQL 9.5 database using this command:

pg_restore -C -d postgres -U postgres --no-owner --role=jsmith the_data.dump

Because the cluster I restored to is not the same as the cluster the dump was made on, some of the roles don't exist.

There were many errors during the restore, but all of them involved GRANT and RESTORE . Can I assume the actual data itself was restored without loss or modification?

The GRANT and REVOKE errors can be ignored. They don't effect the data load.

If you want to avoid the messages in future you can use the -x parameter on pg_restore (you can also use the synonyms --no-acl or --no-privileges ).

This stops pg_restore trying to set the grants.

pg_restore docs at https://www.postgresql.org/docs/current/static/app-pgrestore.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM