4 ms·
> epic fail on the restore if you don’t have users and roles ?? in my lonely research world, the PG backup defaults and restore behavior have always been gent
by mistrial9 6y ago
> epic fail on the restore if you don’t have users and roles
?? in my lonely research world, the PG backup defaults and restore behavior have always been gentle and predictable. I generally backup per-database, never by cluster
- philliphaydon 6y agoI’ve never successfully backed up a single database and restored it on a clean instance of PostgreSQL. It always fails on roles not existing. If I create all the roles up front then it works. But it’s a hassle compared to SQLServer where I can backup, restore, create a user and link him to the database user. And it’s done.
- jeffdavis 6y agoAre you using pg_dump or pg_dumpall? The latter will backup the global objects (like roles) as well. https://www.postgresql.org/docs/current/app-pg-dumpall.html https://www.postgresql.org/docs/current/app-pg-dumpall.html
- stilist 6y agoAn alternative, which I think I borrowed from how Heroku does/did dumps, is 'pg_dump --no-acl --no-owner'.
- AlfeG 6y agoThere is an option to omit roles on backup `--no-owner` https://www.postgresql.org/docs/current/app-pgdump.html https://www.postgresql.org/docs/current/app-pgdump.html