I tried pg_dump
and then on a separate machine I tried to import the sql and populate the database, I see
CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE WARNING: no privileges could be revoked for "public" REVOKE ERROR: role "postgres" does not exist ERROR: role "postgres" does not exist WARNING: no privileges were granted for "public" GRANT
which means my user
and roles
and grant
information is not in pg_dump
On the other hand we have pg_dumpall
, I read conversation, and this does not lead me anywhere?
Question
- Which one should I be using for database backups? pg_dump
or pg_dumpall
?
- the requirement is that I can take the backup and should be able to import to any machine and it should work just fine.