Non-superuser support with pgBackRest

Suggest edits

pgBackRest supports non-superuser backups and restores. This feature is useful when you want to delegate backup and restore tasks to non-superusers. To configure non-superuser support, you need to grant the necessary permissions to the non-superuser.

For example, to allow the pgbackrest user to perform backups and restores, you can grant the following permissions:

grant pg_read_all_settings to pgbackrest ;

For EDB Postgres Advanced Server 14 and later:

GRANT EXECUTE on FUNCTION pg_switch_wal to pgbackrest;
GRANT EXECUTE ON FUNCTION pg_start_backup(text, boolean, boolean) to pgbackrest;
GRANT EXECUTE ON FUNCTION pg_stop_backup(boolean, boolean) TO pgbackrest;
GRANT EXECUTE ON FUNCTION pg_catalog.pg_create_restore_point(text) TO pgbackrest;

For EDB Postgres 15 and later:

In EDB Postgres 15 and later versions, pg_start_backup and pg_stop_backup functions are changed to pg_backup_start and pg_backup_stop.

GRANT EXECUTE on FUNCTION pg_switch_wal to pgbackrest ;
GRANT EXECUTE ON FUNCTION pg_backup_start(label text, fast boolean) TO pgbackrest;
GRANT EXECUTE ON FUNCTION pg_backup_stop(wait_for_archive boolean) TO pgbackrest;
GRANT EXECUTE ON FUNCTION pg_catalog.pg_create_restore_point(text) TO pgbackrest;

Could this page be better? Report a problem or suggest an addition!