M
M
Mike2020-02-18 16:32:20
PostgreSQL
Mike, 2020-02-18 16:32:20

How to remove 'role' for user in Postgres db?

There is a database 'ef' and a user 'rightuser'.
I dump the database 'pg_dump -h localhost -U rightuser -F c -f dumpfile ef'
Then I share the restore from the dumpfile `pg_restore -h localhost -U rightuser -F c -d ef dumpfile`
Then I run my application, everything works, but when restoring from dumpfile, i get this.

pg_restore: [archiver (db)] Error from TOC entry 3366; 0 0 ACL SEQUENCE socialaccount_socialapp_id_seq rightuser
pg_restore: [archiver (db)] could not execute query: ERROR:  role "efuser" does not exist
    Command was: GRANT ALL ON SEQUENCE public.socialaccount_socialapp_id_seq TO efuser;

There actually go exactly the same error but to other tables in the database.
How do I get rid of this user `efuser`. I remember that I created this user a month ago and gave him various privileges. Maybe just remove `efuser` from the database, or revoke all privileges for this user?

In that base from which I do dump, there is a user 'efuser'. But in the database where I upload the dumpfile, there is no 'efuser' user there.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question