Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 235
user1071847 Avatar asked Jul 14 '26 10:07

user1071847


1 Answers

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

like image 103
Gary Avatar answered Jul 17 '26 16:07

Gary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!