Time-of-check Time-of-use (TOCTOU) race condition in pg_dump in PostgreSQL allows an object creator to execute arbitrary SQL functions as the user running pg_dump, which is often a superuser.
And this, my friends, is why you create a separate user to do the backups with read-only privileges.
And this, my friends, is why you create a separate user to do the backups with read-only privileges.