Pg_Dump: [Archiver (Db)] Query Failed: Error: Permission Denied for Relation Abouts

pg_dump: [archiver (db)] query failed: ERROR: permission denied for relation abouts

The user which you're performing your pg_dump as doesn't have permissions on the public schema.

Add permissions if allowed:

GRANT USAGE ON SCHEMA public TO <user>;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO <user>;

Not able to pg_dump due to permission, despite having permissions

You need the USAGE privilege on schema londiste and the SELECT privilege on londiste.provider_seq.

pg_dump a db that doesn't have root user

This:

pg_dump lhhsweb > lhhs.sql

should be specified as at minimum as:

pg_dump -U <db_owner or superuser> -d lhhsweb -f lhhs.sql

Where <db_owner or superuser> is the Postgres user that owns the database or is a superuser. In any case a user(role) that has sufficient privileges to dump the entire database.

The reason you are getting the error is that in the absence of -U(user) the user name used is that of the system user the command is being run as, per Parameter Key words.:

user

PostgreSQL user name to connect as. Defaults to be the same as the operating system name of the user running the application.

I suggest spending some time at the above link to see what the other key words mean also. It will make things clearer and prevent issues down the road.

In conclusion, in modern versions of Postgres the term user is an alias for role, with the convention that a role that can login can also be referred to as a user. Postgres has its own set of users internal to the database that are independent of the OS system users. When you are extracting information from the database you need to be using those users. In particular a user that has the necessary privileges.

permission denied for relation django_migrations

Sounds like it's down to permissions, so make sure you at least have USAGE for relevant schema and the SELECT privilege for the table.

Check out this answer for much greater detail.



Related Topics



Leave a reply



Submit